fix conditions

substraction from an unsigned
This commit is contained in:
Anatol Belski 2014-09-14 10:24:10 +02:00
parent 65100a6474
commit ea4ab02446

View file

@ -524,7 +524,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
int1store(p, packet->auth_data_len); int1store(p, packet->auth_data_len);
++p; ++p;
/*!!!!! is the buffer big enough ??? */ /*!!!!! is the buffer big enough ??? */
if ((sizeof(buffer) - (p - buffer)) < packet->auth_data_len) { if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) {
DBG_ERR("the stack buffer was not enough!!"); DBG_ERR("the stack buffer was not enough!!");
DBG_RETURN(0); DBG_RETURN(0);
} }
@ -596,7 +596,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
} }
#endif #endif
if ((sizeof(buffer) - (p - buffer)) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len))) { if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - buffer))) {
p = php_mysqlnd_net_store_length(p, ca_payload_len); p = php_mysqlnd_net_store_length(p, ca_payload_len);
#ifdef OLD_CODE #ifdef OLD_CODE