[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-07-01 Thread Johannes Schlüter
johannesWed Jul  1 14:13:07 2009 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  MFB52: Fix include path
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.34r2=1.35diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.34 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.35
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.34 Sun Jun 28 12:41:51 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Wed Jul  1 14:13:07 2009
@@ -25,7 +25,7 @@
 #include mysqlnd_statistics.h
 #include mysqlnd_palloc.h
 #include mysqlnd_debug.h
-#include mysqlnd/mysqlnd_block_alloc.h
+#include mysqlnd_block_alloc.h
 #include ext/standard/sha1.h
 #include php_network.h
 #include zend_ini.h



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-07-01 Thread Johannes Schlüter
On Wed, 2009-07-01 at 14:13 +, Johannes Schlüter wrote:
 johannes  Wed Jul  1 14:13:07 2009 UTC
 
   Modified files:  
 /php-src/ext/mysqlnd  mysqlnd_wireprotocol.c 
   Log:
   MFB52: Fix include path
5.3 is the one where this was fixed, 5.2 doesn't have this file ...

johannes



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-28 Thread Pierre-Alain Joye
pajoye  Sun Jun 28 12:41:51 2009 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  - fix build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.33r2=1.34diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.33 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.34
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.33 Tue Jun 16 09:15:09 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Sun Jun 28 12:41:51 2009
@@ -25,6 +25,7 @@
 #include mysqlnd_statistics.h
 #include mysqlnd_palloc.h
 #include mysqlnd_debug.h
+#include mysqlnd/mysqlnd_block_alloc.h
 #include ext/standard/sha1.h
 #include php_network.h
 #include zend_ini.h
@@ -1473,7 +1474,7 @@
end_field = (current_field = start_field = fields) + field_count;
for (i = 0; current_field  end_field; current_field++, i++) {
/* Don't reverse the order. It is significant!*/
-   void *obj;
+   void *obj = NULL;
zend_bool allocated = TRUE;
zend_uchar *this_field_len_pos = p;
/* php_mysqlnd_net_field_length() call should be after 
*this_field_len_pos = p; */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-11 Thread Andrey Hristov
andrey  Thu Jun 11 08:32:34 2009 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  Check the pointer before calling a function on it, or we will crash.
  This is a very rare situation where the server is totally broken.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.27r2=1.28diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.27 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.28
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.27 Mon Jun  8 10:19:29 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Thu Jun 11 08:32:34 2009
@@ -1344,7 +1344,7 @@
break;
}
}
-   if (ret == FAIL) {
+   if (ret == FAIL  (*buffer)) {
(*buffer)-free_chunk((*buffer), TRUE TSRMLS_CC);
*buffer = NULL;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-11 Thread Pierre-Alain Joye
pajoye  Thu Jun 11 17:14:34 2009 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  - MF53: silent warning and make it less ambiguous
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.28r2=1.29diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.28 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.29
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.28 Thu Jun 11 08:32:34 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Thu Jun 11 17:14:34 2009
@@ -612,7 +612,7 @@
/* pad2 */
p+= 13;
 
-   if (p - buf  packet-header.size) {
+   if ((size_t)(p - buf)  packet-header.size) {
/* scramble_buf is split into two parts */
memcpy(packet-scramble_buf + SCRAMBLE_LENGTH_323,
p, SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323);
@@ -626,7 +626,7 @@
DBG_INF_FMT(server_capabilities=%d charset_no=%d server_status=%d,
packet-server_capabilities, 
packet-charset_no, packet-server_status);
 
-   if (p - begin  packet-header.size) {
+   if ((size_t)(p - begin)  packet-header.size) {
DBG_ERR_FMT(GREET packet %d bytes shorter than expected, p - 
begin - packet-header.size);
php_error_docref(NULL TSRMLS_CC, E_WARNING, GREET packet 
MYSQLND_SZ_T_SPEC bytes shorter than expected,
 p - begin - 
packet-header.size);
@@ -811,7 +811,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 = pestrndup((char *)p, MIN(i, sizeof(buf) - (p 
- buf)), conn-persistent);
packet-message_len = i;
} else {
@@ -822,7 +822,7 @@
packet-affected_rows, packet-last_insert_id, 
packet-server_status,
packet-warning_count);
 
-   if (p - begin  packet-header.size) {
+   if ((size_t)(p - begin)  packet-header.size) {
DBG_ERR_FMT(OK packet %d bytes shorter than expected, p - 
begin - packet-header.size);
php_error_docref(NULL TSRMLS_CC, E_WARNING, OK packet 
MYSQLND_SZ_T_SPEC bytes shorter than expected,
 p - begin - 
packet-header.size);
@@ -895,7 +895,7 @@
packet-server_status = 0;
}
 
-   if (p - begin  packet-header.size) {
+   if ((size_t)(p - begin)  packet-header.size) {
DBG_ERR_FMT(EOF packet %d bytes shorter than expected, p - 
begin - packet-header.size);
php_error_docref(NULL TSRMLS_CC, E_WARNING, EOF packet 
MYSQLND_SZ_T_SPEC bytes shorter than expected,
 p - begin - 
packet-header.size);
@@ -1045,7 +1045,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_pemalloc(len + 
1, conn-persistent);
memcpy(packet-info_or_local_file, p, len);
packet-info_or_local_file[len] = '\0';
@@ -1060,7 +1060,7 @@
/* Result set */
break;
}
-   if (p - begin  packet-header.size) {
+   if ((size_t)(p - begin)  packet-header.size) {
DBG_ERR_FMT(RSET_HEADER packet %d bytes shorter than 
expected, p - begin - packet-header.size);
php_error_docref(NULL TSRMLS_CC, E_WARNING, GREET packet 
MYSQLND_SZ_T_SPEC bytes shorter than expected,
 p - begin - 
packet-header.size);
@@ -1188,7 +1188,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)
{
@@ -1200,7 +1200,7 @@
p += len;
}
 
-   if (p - begin  packet-header.size) {
+   if ((size_t)(p - begin)  packet-header.size) {
DBG_ERR_FMT(RSET field packet %d bytes shorter than expected, 
p - begin - packet-header.size);
php_error_docref(NULL TSRMLS_CC, E_WARNING, Result set field 
packet MYSQLND_SZ_T_SPEC bytes 
  

[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-11 Thread Pierre-Alain Joye
pajoye  Thu Jun 11 17:16:35 2009 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  - nuke unused var
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.29r2=1.30diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.29 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.30
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.29 Thu Jun 11 17:14:34 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Thu Jun 11 17:16:35 2009
@@ -1364,7 +1364,6 @@
zval **current_field, **end_field, **start_field;
zend_bool as_unicode = conn-options.numeric_and_datetime_as_unicode;
zend_bool allocated;
-   void *obj;
 
DBG_ENTER(php_mysqlnd_rowp_read_binary_protocol);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-11 Thread Andrey Hristov

 Hi Pierre,
Pierre-Alain Joye wrote:

pajoye  Thu Jun 11 17:16:35 2009 UTC

  Modified files:  
/php-src/ext/mysqlnd	mysqlnd_wireprotocol.c 
  Log:

  - nuke unused var
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.29r2=1.30diff_format=u

Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.29 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.30
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.29 Thu Jun 11 17:14:34 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Thu Jun 11 17:16:35 2009
@@ -1364,7 +1364,6 @@
zval **current_field, **end_field, **start_field;
zend_bool as_unicode = conn-options.numeric_and_datetime_as_unicode;
zend_bool allocated;
-   void *obj;
 
 	DBG_ENTER(php_mysqlnd_rowp_read_binary_protocol);
 


I don't like the change and will revert it. In any case, next time you 
do a change to mysqlnd please merge it with the other branch. In this 
case change was in HEAD and not merged into PHP5_3. This is not the 
first time I see this happening. mysqlnd in 5_3 and HEAD _should_ be in 
sync - exactly the same code except for the cvs tags. This makes the 
life easier.


Andrey

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-11 Thread Pierre Joye
On Thu, Jun 11, 2009 at 7:47 PM, Andrey Hristovp...@hristov.com wrote:

 I don't like the change and will revert it. In any case, next time you do a
 change to mysqlnd please merge it with the other branch. In this case change
 was in HEAD and not merged into PHP5_3. This is not the first time I see
 this happening. mysqlnd in 5_3 and HEAD _should_ be in sync - exactly the
 same code except for the cvs tags. This makes the life easier.

My last commits have nothing to do with this warning.

However, all branches should indeed be synced :)
Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2009-06-11 Thread Andrey Hristov
andrey  Thu Jun 11 17:53:14 2009 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  Revert by adding an ifdef
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.30r2=1.31diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.30 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.31
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.30 Thu Jun 11 17:16:35 2009
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Thu Jun 11 17:53:13 2009
@@ -1363,7 +1363,10 @@
zend_uchar *null_ptr, bit;
zval **current_field, **end_field, **start_field;
zend_bool as_unicode = conn-options.numeric_and_datetime_as_unicode;
+#ifdef USE_ZVAL_CACHE
zend_bool allocated;
+   void *obj = NULL;
+#endif
 
DBG_ENTER(php_mysqlnd_rowp_read_binary_protocol);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_wireprotocol.c

2008-02-25 Thread Rob Richards
rrichards   Mon Feb 25 22:56:06 2008 UTC

  Modified files:  
/php-src/ext/mysqlndmysqlnd_wireprotocol.c 
  Log:
  fix win32 build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.13r2=1.14diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.13 
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.14
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.13 Wed Feb 20 15:20:14 2008
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c  Mon Feb 25 22:56:06 2008
@@ -1672,8 +1672,10 @@
 static
 void php_mysqlnd_rowp_free_mem(void *_packet, zend_bool alloca TSRMLS_DC)
 {
+   php_mysql_packet_row *p;
+
DBG_ENTER(php_mysqlnd_rowp_free_mem);
-   php_mysql_packet_row *p= (php_mysql_packet_row *) _packet;
+   p = (php_mysql_packet_row *) _packet;
if (p-row_buffer) {
p-row_buffer-free_chunk(p-row_buffer, TRUE TSRMLS_CC);
p-row_buffer = NULL;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php