andrey Thu, 15 Apr 2010 15:58:26 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298046
Log:
Last batch of int/uint comparison fixes
Changed paths:
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
U php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
2010-04-15 15:53:58 UTC (rev 298045)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
2010-04-15 15:58:26 UTC (rev 298046)
@@ -545,7 +545,7 @@
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 @@
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 @@
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)
{
Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-04-15
15:53:58 UTC (rev 298045)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-04-15
15:58:26 UTC (rev 298046)
@@ -545,7 +545,7 @@
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 @@
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 @@
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)
{
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php