com php-src: Fix incorrect shift in mysqlnd_wireprotocol: ext/mysqlnd/mysqlnd_wireprotocol.c
| From: | Nikita Popov | Date: | Wed, 19 Jun 2019 13:09:00 +0000 |
| Subject: | com php-src: Fix incorrect shift in mysqlnd_wireprotocol: ext/mysqlnd/mysqlnd_wireprotocol.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106891@lists.php.net to get a copy of this message | ||
Commit: 22765160da028590aafc073cc2edbb088e28f436
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 19 Jun 2019 14:22:05 +0200
Parents: 4ae87f4bf964146d8da1deb64cf1b668f1103891
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=22765160da028590aafc073cc2edbb088e28f436
Log:
Fix incorrect shift in mysqlnd_wireprotocol
This one looks like a genuine bug: We're shifting a uint16_t by
16 bits. On x86 that likely results in no shift happening.
Changed paths:
M ext/mysqlnd/mysqlnd_wireprotocol.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 6ef48a4..609fd98 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -420,7 +420,7 @@ php_mysqlnd_greet_read(MYSQLND_CONN_DATA * conn, void * _packet)
p--;
/* Additional 16 bits for server capabilities */
- packet->server_capabilities |= uint2korr(pad_start) << 16;
+ packet->server_capabilities |= (uint32_t) uint2korr(pad_start) << 16;
/* And a length of the server scramble in one byte */
packet->authentication_plugin_data.l = uint1korr(pad_start + 2);
if (packet->authentication_plugin_data.l > SCRAMBLE_LENGTH) {