bug38710.phpt 621 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #38710 (data leakage because of nonexisting boundary checking in statements)
  3. --EXTENSIONS--
  4. mysqli
  5. --SKIPIF--
  6. <?php
  7. require_once('skipifconnectfailure.inc');
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once("connect.inc");
  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();
  18. if ($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. }
  21. echo "Done";
  22. ?>
  23. --EXPECT--
  24. Done