xref: /PHP-7.2/ext/mysqli/tests/bug38710.phpt (revision f1d7e3ca)
1--TEST--
2Bug #38710 (data leakage because of nonexisting boundary checking in statements)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10require_once("connect.inc");
11
12$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
13$qry=$db->stmt_init();
14$qry->prepare("SELECT REPEAT('a',100000)");
15$qry->execute();
16$qry->bind_result($text);
17$qry->fetch();
18if ($text !== str_repeat('a', ($IS_MYSQLND || mysqli_get_server_version($db) > 50110)? 100000:(mysqli_get_server_version($db)>=50000? 8193:8191))) {
19	var_dump(strlen($text));
20}
21echo "Done";
22?>
23--EXPECTF--
24Done
25