Bug #68544 [Asn->Opn]: Mysqlnd fails with compression active and big random data
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 08:14:15 +0000 |
| Subject: | Bug #68544 [Asn->Opn]: Mysqlnd fails with compression active and big random data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212248@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68544&edit=1
ID: 68544
Updated by: kalle@php.net
Reported by: bwoebi@php.net
Summary: Mysqlnd fails with compression active and big random
data
-Status: Assigned
+Status: Open
Type: Bug
Package: MySQLi related
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To: mysql
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2014-12-03 20:03:09] bwoebi@php.net
Description:
------------
If the compressed packet payload is bigger than 0xffffff (because DEFLATE increased the size), then
the payload length will overflow on 24 bit boundary and PHP ends up with a warning and fails.
Test script:
---------------
ini_set("memory_limit", "1G");
$db = mysqli_init();
$db->real_connect(HOST, USER, PASS, DB, 3306, null, MYSQL_CLIENT_COMPRESS);
$q = $db->prepare("INSERT INTO tmp (text) VALUES (?)");
$n = null;
$q->bind_param('b', $n);
$x = file_get_contents("/dev/urandom", 0, null, -1, 0xffffff - 1);
$q->send_long_data(0, $x);
$q->execute();
Expected result:
----------------
Successful insert in database...
Actual result:
--------------
Warning: Error while sending STMT_SEND_LONG_DATA packet. PID=%d in %s on line %d
(Doesn't matter if QUERY, PREPARE or STMT_SEND_LONG_DATA packet or what ever; issue is always
the same.)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68544&edit=1