From 664b2389cac7921fca1c6c33b3fc97b438e0050e Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Thu, 15 Apr 2010 15:58:26 +0000 Subject: [PATCH] Last batch of int/uint comparison fixes --- ext/mysqlnd/mysqlnd_wireprotocol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 040db1352c..66013837cf 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -545,7 +545,7 @@ php_mysqlnd_ok_read(void *_packet, MYSQLND *conn TSRMLS_DC) p+= 2; /* There is a message */ - if (packet->header.size > p - buf && (i = php_mysqlnd_net_field_length(&p))) { + if (packet->header.size > (size_t) (p - buf) && (i = php_mysqlnd_net_field_length(&p))) { packet->message = mnd_pestrndup((char *)p, MIN(i, buf_len - (p - begin)), FALSE); packet->message_len = i; } else { @@ -780,7 +780,7 @@ php_mysqlnd_rset_header_read(void *_packet, MYSQLND *conn TSRMLS_DC) packet->warning_count = uint2korr(p); p+=2; /* Check for additional textual data */ - if (packet->header.size > (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { + if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { packet->info_or_local_file = mnd_emalloc(len + 1); memcpy(packet->info_or_local_file, p, len); packet->info_or_local_file[len] = '\0'; @@ -935,7 +935,7 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC) NULL_LENGTH (0xFB) comes from COM_FIELD_LIST when the default value is NULL. Otherwise the string is length encoded. */ - if (packet->header.size > (p - buf) && + if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p)) && len != MYSQLND_NULL_LENGTH) { -- 2.40.0