Skip to content

Commit 2276516

Browse files
committed
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.
1 parent 4ae87f4 commit 2276516

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ php_mysqlnd_greet_read(MYSQLND_CONN_DATA * conn, void * _packet)
420420
p--;
421421

422422
/* Additional 16 bits for server capabilities */
423-
packet->server_capabilities |= uint2korr(pad_start) << 16;
423+
packet->server_capabilities |= (uint32_t) uint2korr(pad_start) << 16;
424424
/* And a length of the server scramble in one byte */
425425
packet->authentication_plugin_data.l = uint1korr(pad_start + 2);
426426
if (packet->authentication_plugin_data.l > SCRAMBLE_LENGTH) {

0 commit comments

Comments
 (0)