summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2019-06-21 16:30:25 +0300
committerAndrey Hristov <andrey@php.net>2019-06-21 16:31:56 +0300
commit102c64e8274e072426c95f8805dd727e87c5f69d (patch)
treec5b462789958cbd7da0b6f02ff0ac93b8f5cfeb3
parent99f3e0f0ed6668097bf4fb2820f3e97db1197869 (diff)
downloadphp-git-102c64e8274e072426c95f8805dd727e87c5f69d.tar.gz
Add explicit cast to uint32_t.
It works even without it but explicit stuff is better. The compiler probably converts the 16-bit uint16_t to uint32_t before doing the shift.
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index b9cbb17894..7616540e4f 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -392,6 +392,7 @@ php_mysqlnd_greet_read(void * _packet)
packet->server_capabilities = uint2korr(p);
p+= 2;
BAIL_IF_NO_MORE_DATA;
+ DBG_INF_FMT("4.1 server_caps=%u\n", (uint32_t) packet->server_capabilities);
packet->charset_no = uint1korr(p);
p++;
@@ -421,7 +422,8 @@ php_mysqlnd_greet_read(void * _packet)
p--;
/* Additional 16 bits for server capabilities */
- packet->server_capabilities |= uint2korr(pad_start) << 16;
+ DBG_INF_FMT("additional 5.5+ caps=%u\n", (uint32_t) uint2korr(pad_start));
+ 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) {