1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 04:02:19 +02:00

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.
This commit is contained in:
Nikita Popov
2019-06-19 14:22:05 +02:00
parent 4ae87f4bf9
commit 22765160da

View File

@@ -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) {