[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ acinclude.m4

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 09:05:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298893

Log:
- update bison version (mike)

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/acinclude.m4

Modified: php/php-src/branches/PHP_5_3/Zend/acinclude.m4
===
--- php/php-src/branches/PHP_5_3/Zend/acinclude.m4  2010-05-03 08:29:31 UTC 
(rev 298892)
+++ php/php-src/branches/PHP_5_3/Zend/acinclude.m4  2010-05-03 09:05:30 UTC 
(rev 298893)
@@ -4,7 +4,7 @@

 AC_DEFUN([LIBZEND_BISON_CHECK],[
   # we only support certain bison versions
-  bison_version_list=1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1
+  bison_version_list=1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2

   # for standalone build of Zend Engine
   test -z $SED  SED=sed

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ acinclude.m4

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 09:05:54 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298894

Log:
- update bison version (mike)

Changed paths:
U   php/php-src/trunk/Zend/acinclude.m4

Modified: php/php-src/trunk/Zend/acinclude.m4
===
--- php/php-src/trunk/Zend/acinclude.m4 2010-05-03 09:05:30 UTC (rev 298893)
+++ php/php-src/trunk/Zend/acinclude.m4 2010-05-03 09:05:54 UTC (rev 298894)
@@ -4,7 +4,7 @@

 AC_DEFUN([LIBZEND_BISON_CHECK],[
   # we only support certain bison versions
-  bison_version_list=1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1
+  bison_version_list=1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2

   # for standalone build of Zend Engine
   test -z $SED  SED=sed

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

[PHP-CVS] svn: /php/php-src/trunk/ext/spl/ spl_observer.c

2010-05-03 Thread Kalle Sommer Nielsen
kalleMon, 03 May 2010 09:21:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298895

Log:
Fix build, declarings first

Changed paths:
U   php/php-src/trunk/ext/spl/spl_observer.c

Modified: php/php-src/trunk/ext/spl/spl_observer.c
===
--- php/php-src/trunk/ext/spl/spl_observer.c2010-05-03 09:05:54 UTC (rev 
298894)
+++ php/php-src/trunk/ext/spl/spl_observer.c2010-05-03 09:21:21 UTC (rev 
298895)
@@ -384,12 +384,13 @@

 int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval 
*obj TSRMLS_DC) /* {{{ */
 {
-   int hash_len;
+   int hash_len, found;
char *hash = spl_object_storage_get_hash(intern, this, obj, hash_len 
TSRMLS_CC);
if (!hash) {
return 0;
}
-   int found = zend_hash_exists(intern-storage, hash, hash_len);
+
+   found = zend_hash_exists(intern-storage, hash, hash_len);
spl_object_storage_free_hash(intern, hash);
return found;
 } /* }}} */

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd.c trunk/ext/mysqlnd/mysqlnd.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 13:45:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298901

Log:
Better handing of OOM in mysqlnd::set_client_option

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-05-03 13:22:06 UTC 
(rev 298900)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-05-03 13:45:58 UTC 
(rev 298901)
@@ -1122,6 +1122,7 @@
   
FALSE, TRUE TSRMLS_CC)) {
DBG_RETURN(NULL);
}
+
/*
   Prepare for the worst case.
   MyISAM goes to 2500 BIT columns, double it for safety.
@@ -1981,20 +1982,26 @@
}
break;
case MYSQL_INIT_COMMAND:
+   {
+   char ** new_init_commands;
+   char * new_command;
DBG_INF(MYSQL_INIT_COMMAND);
DBG_INF_FMT(command=%s, value);
/* when num_commands is 0, then realloc will be 
effectively a malloc call, internally */
-   conn-options.init_commands = 
mnd_perealloc(conn-options.init_commands, sizeof(char *) * 
(conn-options.num_commands + 1),
-   
conn-persistent);
-   if (!conn-options.init_commands) {
+   /* Don't assign to conn-options.init_commands because 
in case of OOM we will lose the pointer and leak */
+   new_init_commands = 
mnd_perealloc(conn-options.init_commands, sizeof(char *) * 
(conn-options.num_commands + 1), conn-persistent);
+   if (!new_init_commands) {
goto oom;
}
-   conn-options.init_commands[conn-options.num_commands] 
= mnd_pestrdup(value, conn-persistent);
-   if 
(!conn-options.init_commands[conn-options.num_commands]) {
+   conn-options.init_commands = new_init_commands;
+   new_command = mnd_pestrdup(value, conn-persistent);
+   if (!new_command) {
goto oom;
}
+   conn-options.init_commands[conn-options.num_commands] 
= new_command;
++conn-options.num_commands;
break;
+   }
case MYSQL_READ_DEFAULT_FILE:
case MYSQL_READ_DEFAULT_GROUP:
 #ifdef WHEN_SUPPORTED_BY_MYSQLI
@@ -2004,17 +2011,19 @@
/* currently not supported. Todo!! */
break;
case MYSQL_SET_CHARSET_NAME:
+   {
+   char * new_charset_name = mnd_pestrdup(value, 
conn-persistent);
DBG_INF(MYSQL_SET_CHARSET_NAME);
+   if (!new_charset_name) {
+   goto oom;
+   }
if (conn-options.charset_name) {
mnd_pefree(conn-options.charset_name, 
conn-persistent);
-   conn-options.charset_name = NULL;
}
-   conn-options.charset_name = mnd_pestrdup(value, 
conn-persistent);
-   if (!conn-options.charset_name) {
-   goto oom;
-   }
+   conn-options.charset_name = new_charset_name;
DBG_INF_FMT(charset=%s, conn-options.charset_name);
break;
+   }
 #ifdef WHEN_SUPPORTED_BY_MYSQLI
case MYSQL_SET_CHARSET_DIR:
case MYSQL_OPT_RECONNECT:

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c 2010-05-03 13:22:06 UTC (rev 
298900)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c 2010-05-03 13:45:58 UTC (rev 
298901)
@@ -1122,6 +1122,7 @@
   
FALSE, TRUE TSRMLS_CC)) {
DBG_RETURN(NULL);
}
+
/*
   Prepare for the worst case.
   MyISAM goes to 2500 BIT columns, double it for safety.
@@ -1981,20 +1982,26 @@
}
break;
case MYSQL_INIT_COMMAND:
+   {
+   char ** new_init_commands;
+   char * new_command;
DBG_INF(MYSQL_INIT_COMMAND);
  

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c trunk/ext/mysqlnd/mysqlnd_debug.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 13:51:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298902

Log:
Fix compiler warnings - unused functions

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c2010-05-03 
13:45:58 UTC (rev 298901)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c2010-05-03 
13:51:30 UTC (rev 298902)
@@ -28,60 +28,6 @@
 #include mysqlnd_statistics.h
 #include zend_builtin_functions.h

-static void * mysqlnd_zend_mm_emalloc(size_t size MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_pemalloc(size_t size, zend_bool persistent 
MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_ecalloc(unsigned int nmemb, size_t size 
MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_pecalloc(unsigned int nmemb, size_t size, 
zend_bool persistent MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_erealloc(void *ptr, size_t new_size 
MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_perealloc(void *ptr, size_t new_size, zend_bool 
persistent MYSQLND_MEM_D);
-static void mysqlnd_zend_mm_efree(void * ptr MYSQLND_MEM_D);
-static void mysqlnd_zend_mm_pefree(void * ptr, zend_bool persistent 
MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_malloc(size_t size MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_calloc(unsigned int nmemb, size_t size 
MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_realloc(void * ptr, size_t new_size 
MYSQLND_MEM_D);
-static void mysqlnd_zend_mm_free(void * ptr MYSQLND_MEM_D);
-static char * mysqlnd_zend_mm_pestrndup(const char * const ptr, size_t length, 
zend_bool persistent MYSQLND_MEM_D);
-static char * mysqlnd_zend_mm_pestrdup(const char * const ptr, zend_bool 
persistent MYSQLND_MEM_D);
-
-#define MYSQLND_DEBUG_MEMORY 1
-
-struct st_mysqlnd_allocator_methods mysqlnd_allocator =
-{
-#if MYSQLND_DEBUG_MEMORY
-   _mysqlnd_emalloc,
-   _mysqlnd_pemalloc,
-   _mysqlnd_ecalloc,
-   _mysqlnd_pecalloc,
-   _mysqlnd_erealloc,
-   _mysqlnd_perealloc,
-   _mysqlnd_efree,
-   _mysqlnd_pefree,
-   _mysqlnd_malloc,
-   _mysqlnd_calloc,
-   _mysqlnd_realloc,
-   _mysqlnd_free,
-   _mysqlnd_pestrndup,
-   _mysqlnd_pestrdup
-#else
-   mysqlnd_zend_mm_emalloc,
-   mysqlnd_zend_mm_pemalloc,
-   mysqlnd_zend_mm_ecalloc,
-   mysqlnd_zend_mm_pecalloc,
-   mysqlnd_zend_mm_erealloc,
-   mysqlnd_zend_mm_perealloc,
-   mysqlnd_zend_mm_efree,
-   mysqlnd_zend_mm_pefree,
-   mysqlnd_zend_mm_malloc,
-   mysqlnd_zend_mm_calloc,
-   mysqlnd_zend_mm_realloc,
-   mysqlnd_zend_mm_free,
-   mysqlnd_zend_mm_pestrndup,
-   mysqlnd_zend_mm_pestrdup
-#endif
-};
-
-
-
 static const char * const mysqlnd_debug_default_trace_file = 
/tmp/mysqlnd.trace;

 #ifdef ZTS
@@ -1046,6 +992,7 @@
 }
 /* }}} */

+#if MYSQLND_DEBUG_MEMORY

 /* {{{ mysqlnd_zend_mm_emalloc */
 static void * mysqlnd_zend_mm_emalloc(size_t size MYSQLND_MEM_D)
@@ -1158,8 +1105,48 @@
 }
 /* }}} */

+#endif


+#define MYSQLND_DEBUG_MEMORY 1
+
+struct st_mysqlnd_allocator_methods mysqlnd_allocator =
+{
+#if MYSQLND_DEBUG_MEMORY
+   _mysqlnd_emalloc,
+   _mysqlnd_pemalloc,
+   _mysqlnd_ecalloc,
+   _mysqlnd_pecalloc,
+   _mysqlnd_erealloc,
+   _mysqlnd_perealloc,
+   _mysqlnd_efree,
+   _mysqlnd_pefree,
+   _mysqlnd_malloc,
+   _mysqlnd_calloc,
+   _mysqlnd_realloc,
+   _mysqlnd_free,
+   _mysqlnd_pestrndup,
+   _mysqlnd_pestrdup
+#else
+   mysqlnd_zend_mm_emalloc,
+   mysqlnd_zend_mm_pemalloc,
+   mysqlnd_zend_mm_ecalloc,
+   mysqlnd_zend_mm_pecalloc,
+   mysqlnd_zend_mm_erealloc,
+   mysqlnd_zend_mm_perealloc,
+   mysqlnd_zend_mm_efree,
+   mysqlnd_zend_mm_pefree,
+   mysqlnd_zend_mm_malloc,
+   mysqlnd_zend_mm_calloc,
+   mysqlnd_zend_mm_realloc,
+   mysqlnd_zend_mm_free,
+   mysqlnd_zend_mm_pestrndup,
+   mysqlnd_zend_mm_pestrdup
+#endif
+};
+
+
+
 /* Follows code borrowed from zend_builtin_functions.c because the functions 
there are static */

 #if PHP_MAJOR_VERSION = 6

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c   2010-05-03 13:45:58 UTC 
(rev 298901)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c   2010-05-03 13:51:30 UTC 
(rev 298902)
@@ -28,60 +28,6 @@
 #include mysqlnd_statistics.h
 #include zend_builtin_functions.h

-static void * mysqlnd_zend_mm_emalloc(size_t size MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_pemalloc(size_t size, zend_bool persistent 
MYSQLND_MEM_D);
-static void * mysqlnd_zend_mm_ecalloc(unsigned int nmemb, size_t size 
MYSQLND_MEM_D);
-static void * 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c trunk/ext/mysqlnd/mys

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 14:16:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298903

Log:
Handle OOM when resizing blocks during data fetch

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c  
2010-05-03 13:51:30 UTC (rev 298902)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c  
2010-05-03 14:16:04 UTC (rev 298903)
@@ -53,7 +53,7 @@


 /* {{{ mysqlnd_mempool_resize_chunk */
-static void
+static enum_func_status
 mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int 
size TSRMLS_DC)
 {
DBG_ENTER(mysqlnd_mempool_resize_chunk);
@@ -68,6 +68,9 @@
if ((chunk-size + pool-free_size)  size) {
zend_uchar *new_ptr;
new_ptr = mnd_malloc(size);
+   if (!new_ptr) {
+   DBG_RETURN(FAIL);
+   }
memcpy(new_ptr, chunk-ptr, chunk-size);
chunk-ptr = new_ptr;
pool-free_size += chunk-size;
@@ -85,6 +88,9 @@
} else {
zend_uchar *new_ptr;
new_ptr = mnd_malloc(size);
+   if (!new_ptr) {
+   DBG_RETURN(FAIL);
+   }
memcpy(new_ptr, chunk-ptr, chunk-size);
chunk-ptr = new_ptr;
chunk-size = size;
@@ -95,7 +101,7 @@
} else {
chunk-ptr = mnd_realloc(chunk-ptr, size);
}
-   DBG_VOID_RETURN;
+   DBG_RETURN(PASS);
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-05-03 
13:51:30 UTC (rev 298902)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-05-03 
14:16:04 UTC (rev 298903)
@@ -48,7 +48,7 @@
MYSQLND_MEMORY_POOL *pool;
zend_uchar  *ptr;
unsigned intsize;
-   void
(*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
+   enum_func_status(*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * 
chunk, unsigned int size TSRMLS_DC);
void(*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK 
* chunk, zend_bool cache_it TSRMLS_DC);
zend_bool   from_pool;
 };

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-05-03 13:51:30 UTC (rev 298902)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c 
2010-05-03 14:16:04 UTC (rev 298903)
@@ -1149,7 +1149,11 @@
  We need a trailing \0 for the last string, in case of 
text-mode,
  to be able to implement read-only variables.
*/
-   (*buffer)-resize_chunk((*buffer), *data_size + 1 
TSRMLS_CC);
+   if (FAIL == (*buffer)-resize_chunk((*buffer), 
*data_size + 1 TSRMLS_CC)) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   break;
+   }
/* The position could have changed, recalculate */
p = (*buffer)-ptr + (*data_size - header.size);
}

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c 2010-05-03 13:51:30 UTC 
(rev 298902)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c 2010-05-03 14:16:04 UTC 
(rev 298903)
@@ -53,7 +53,7 @@


 /* {{{ mysqlnd_mempool_resize_chunk */
-static void
+static enum_func_status
 mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int 
size TSRMLS_DC)
 {
DBG_ENTER(mysqlnd_mempool_resize_chunk);
@@ -68,6 +68,9 @@
if ((chunk-size + 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c trunk/ext/mysqlnd/mysqlnd_block_alloc.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 14:26:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298904

Log:
One more case to handle in case of OOM, in block_alloc_resize_chunk

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c  
2010-05-03 14:16:04 UTC (rev 298903)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c  
2010-05-03 14:26:08 UTC (rev 298904)
@@ -99,7 +99,12 @@
}
}
} else {
-   chunk-ptr = mnd_realloc(chunk-ptr, size);
+   zend_uchar *new_ptr = mnd_realloc(chunk-ptr, size);
+   if (!new_ptr) {
+   DBG_RETURN(FAIL);
+   }
+   chunk-ptr = new_ptr;
+
}
DBG_RETURN(PASS);
 }

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c 2010-05-03 14:16:04 UTC 
(rev 298903)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c 2010-05-03 14:26:08 UTC 
(rev 298904)
@@ -99,7 +99,12 @@
}
}
} else {
-   chunk-ptr = mnd_realloc(chunk-ptr, size);
+   zend_uchar *new_ptr = mnd_realloc(chunk-ptr, size);
+   if (!new_ptr) {
+   DBG_RETURN(FAIL);
+   }
+   chunk-ptr = new_ptr;
+
}
DBG_RETURN(PASS);
 }

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/sapi/apache2handler/ sapi_apache2.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 14:29:07 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298905

Log:
- WS

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c

Modified: php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c 
2010-05-03 14:26:08 UTC (rev 298904)
+++ php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c 
2010-05-03 14:29:07 UTC (rev 298905)
@@ -119,8 +119,8 @@
efree(ctx-content_type);
}
ctx-content_type = estrdup(val);
-   } else if (!strcasecmp(sapi_header-header, 
content-length)) {
-   ap_set_content_length(ctx-r, strtol(val, (char 
**)NULL, 10));
+   } else if (!strcasecmp(sapi_header-header, 
content-length)) {
+   ap_set_content_length(ctx-r, strtol(val, (char 
**)NULL, 10));
} else if (op == SAPI_HEADER_REPLACE) {
apr_table_set(ctx-r-headers_out, 
sapi_header-header, val);
} else {

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

[PHP-CVS] svn: /php/php-src/trunk/sapi/apache2handler/ sapi_apache2.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 14:30:14 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298906

Log:
- WS

Changed paths:
U   php/php-src/trunk/sapi/apache2handler/sapi_apache2.c

Modified: php/php-src/trunk/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/trunk/sapi/apache2handler/sapi_apache2.c2010-05-03 
14:29:07 UTC (rev 298905)
+++ php/php-src/trunk/sapi/apache2handler/sapi_apache2.c2010-05-03 
14:30:14 UTC (rev 298906)
@@ -119,8 +119,8 @@
efree(ctx-content_type);
}
ctx-content_type = estrdup(val);
-   } else if (!strcasecmp(sapi_header-header, 
content-length)) {
-   ap_set_content_length(ctx-r, strtol(val, (char 
**)NULL, 10));
+   } else if (!strcasecmp(sapi_header-header, 
content-length)) {
+   ap_set_content_length(ctx-r, strtol(val, (char 
**)NULL, 10));
} else if (op == SAPI_HEADER_REPLACE) {
apr_table_set(ctx-r-headers_out, 
sapi_header-header, val);
} else {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/phar/phar.c branches/PHP_5_3/ext/phar/tar.c branches/PHP_5_3/ext/phar/zip.c trunk/ext/phar/phar.c trunk/ext/phar/tar.c trunk/ext

2010-05-03 Thread Ilia Alshanetsky
iliaaMon, 03 May 2010 14:41:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298908

Log:
Fixed bug #51690 (Phar::setStub looks for case-sensitive __HALT_COMPILER())

Bug: http://bugs.php.net/51690 (Verified) Phar::setStub looks for 
case-sensitive __HALT_COMPILER()
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/phar/phar.c
U   php/php-src/branches/PHP_5_3/ext/phar/tar.c
U   php/php-src/branches/PHP_5_3/ext/phar/zip.c
U   php/php-src/trunk/ext/phar/phar.c
U   php/php-src/trunk/ext/phar/tar.c
U   php/php-src/trunk/ext/phar/zip.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-05-03 14:32:43 UTC (rev 298907)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-05-03 14:41:40 UTC (rev 298908)
@@ -37,6 +37,8 @@
   requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
 - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (Clément LECIGNE, Stas)

+- Fixed bug #51690 (Phar::setStub looks for case-sensitive
+  __HALT_COMPILER()). (Ilia)
 - Fixed bug #51688 (ini per dir crashes when invalid document root  are given).
   (Pierre)
 - Fixed bug #51671 (imagefill does not work correctly for small images).

Modified: php/php-src/branches/PHP_5_3/ext/phar/phar.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/phar.c2010-05-03 14:32:43 UTC 
(rev 298907)
+++ php/php-src/branches/PHP_5_3/ext/phar/phar.c2010-05-03 14:41:40 UTC 
(rev 298908)
@@ -2563,8 +2563,8 @@
  */
 int phar_flush(phar_archive_data *phar, char *user_stub, long len, int 
convert, char **error TSRMLS_DC) /* {{{ */
 {
-/* static const char newstub[] = ?php __HALT_COMPILER(); ?\r\n; */
-   char *newstub;
+   char halt_stub[] = __HALT_COMPILER();;
+   char *newstub, *tmp;
phar_entry_info *entry, *newentry;
int halt_offset, restore_alias_len, global_flags = 0, closeoldfile;
char *pos, has_dirs = 0;
@@ -2665,8 +2665,9 @@
} else {
free_user_stub = 0;
}
-   if ((pos = strstr(user_stub, __HALT_COMPILER();)) == NULL)
-   {
+   tmp = estrndup(user_stub, len);
+   if ((pos = php_stristr(tmp, halt_stub, len, sizeof(halt_stub) - 
1)) == NULL) {
+   efree(tmp);
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -2679,6 +2680,8 @@
}
return EOF;
}
+   pos = user_stub + (pos - tmp);
+   efree(tmp);
len = pos - user_stub + 18;
if ((size_t)len != php_stream_write(newfile, user_stub, len)
||5 != php_stream_write(newfile,  
?\r\n, 5)) {

Modified: php/php-src/branches/PHP_5_3/ext/phar/tar.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/tar.c 2010-05-03 14:32:43 UTC (rev 
298907)
+++ php/php-src/branches/PHP_5_3/ext/phar/tar.c 2010-05-03 14:41:40 UTC (rev 
298908)
@@ -911,7 +911,8 @@
php_stream *oldfile, *newfile, *stubfile;
int closeoldfile, free_user_stub, signature_length;
struct _phar_pass_tar_info pass;
-   char *buf, *signature, sigbuf[8];
+   char *buf, *signature, *tmp, sigbuf[8];
+   char halt_stub[] = __HALT_COMPILER();;

entry.flags = PHAR_ENT_PERM_DEF_FILE;
entry.timestamp = time(NULL);
@@ -990,7 +991,9 @@
free_user_stub = 0;
}

-   if ((pos = strstr(user_stub, __HALT_COMPILER();)) == NULL) {
+   tmp = estrndup(user_stub, len);
+   if ((pos = php_stristr(tmp, halt_stub, len, sizeof(halt_stub) - 
1)) == NULL) {
+   efree(tmp);
if (error) {
spprintf(error, 0, illegal stub for tar-based 
phar \%s\, phar-fname);
}
@@ -999,6 +1002,8 @@
}
return EOF;
}
+   pos = user_stub + (pos - tmp);
+   efree(tmp);

len = pos - user_stub + 18;
entry.fp = php_stream_fopen_tmpfile();

Modified: php/php-src/branches/PHP_5_3/ext/phar/zip.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/zip.c 2010-05-03 14:32:43 UTC (rev 
298907)
+++ php/php-src/branches/PHP_5_3/ext/phar/zip.c 2010-05-03 14:41:40 UTC (rev 
298908)
@@ -1167,6 +1167,9 @@
char *pos;
smart_str main_metadata_str = {0};
static const char newstub[] = ?php // zip-based phar archive stub 
file\n__HALT_COMPILER();;
+   char 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c branches/PHP_5_3/ext/mysqlnd/mys

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 16:09:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298910

Log:
Remove unused parameter

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c	2010-05-03 15:33:08 UTC (rev 298909)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c	2010-05-03 16:09:05 UTC (rev 298910)
@@ -29,7 +29,7 @@

 /* {{{ mysqlnd_mempool_free_chunk */
 static void
-mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it TSRMLS_DC)
+mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC)
 {
 	MYSQLND_MEMORY_POOL * pool = chunk-pool;
 	DBG_ENTER(mysqlnd_mempool_free_chunk);
@@ -130,8 +130,12 @@
 	*/
 	chunk-pool = pool;
 	if (size  pool-free_size) {
+		chunk-from_pool = FALSE;
 		chunk-ptr = mnd_malloc(size);
-		chunk-from_pool = FALSE;
+		if (!chunk-ptr) {
+			chunk-free_chunk(chunk TSRMLS_CC);
+			chunk = NULL;
+		}
 	} else {
 		chunk-from_pool = TRUE;
 		++pool-refcount;

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c	2010-05-03 15:33:08 UTC (rev 298909)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c	2010-05-03 16:09:05 UTC (rev 298910)
@@ -819,7 +819,7 @@
 			  the bound variables. Thus we need to do part of what it does or Zend will
 			  report leaks.
 			*/
-			row_packet-row_buffer-free_chunk(row_packet-row_buffer, TRUE TSRMLS_CC);
+			row_packet-row_buffer-free_chunk(row_packet-row_buffer TSRMLS_CC);
 			row_packet-row_buffer = NULL;
 		}
 	} else if (ret == FAIL) {
@@ -998,13 +998,13 @@
 			  the bound variables. Thus we need to do part of what it does or Zend will
 			  report leaks.
 			*/
-			row_packet-row_buffer-free_chunk(row_packet-row_buffer, TRUE TSRMLS_CC);
+			row_packet-row_buffer-free_chunk(row_packet-row_buffer TSRMLS_CC);
 			row_packet-row_buffer = NULL;
 		}
 		/* We asked for one row, the next one should be EOF, eat it */
 		ret = PACKET_READ(row_packet, result-conn);
 		if (row_packet-row_buffer) {
-			row_packet-row_buffer-free_chunk(row_packet-row_buffer, TRUE TSRMLS_CC);
+			row_packet-row_buffer-free_chunk(row_packet-row_buffer TSRMLS_CC);
 			row_packet-row_buffer = NULL;
 		}
 		MYSQLND_INC_CONN_STATISTIC(stmt-conn-stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR);

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2010-05-03 15:33:08 UTC (rev 298909)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2010-05-03 16:09:05 UTC (rev 298910)
@@ -166,7 +166,7 @@
 	if (unbuf-last_row_buffer) {
 		DBG_INF(Freeing last row buffer);
 		/* Nothing points to this buffer now, free it */
-		unbuf-last_row_buffer-free_chunk(unbuf-last_row_buffer, TRUE TSRMLS_CC);
+		unbuf-last_row_buffer-free_chunk(unbuf-last_row_buffer TSRMLS_CC);
 		unbuf-last_row_buffer = NULL;
 	}

@@ -207,7 +207,7 @@
 #if MYSQLND_DEBUG_MEMORY
 		DBG_INF(Freeing current_row  current_buffer);
 #endif
-		current_buffer-free_chunk(current_buffer, TRUE TSRMLS_CC);
+		current_buffer-free_chunk(current_buffer TSRMLS_CC);
 	}
 	DBG_INF(Freeing data  row_buffer);
 	if (set-data) {

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h	2010-05-03 15:33:08 UTC (rev 298909)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h	2010-05-03 16:09:05 UTC (rev 298910)
@@ -49,7 +49,7 @@
 	zend_uchar			*ptr;
 	unsigned int		size;
 	enum_func_status	(*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
-	void(*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it TSRMLS_DC);
+	void(*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC);
 	zend_bool			from_pool;
 };


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
===
--- 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/zend_hash.c branches/PHP_5_3/Zend/zend_hash.c trunk/Zend/zend_hash.c

2010-05-03 Thread Felipe Pena
felipe   Mon, 03 May 2010 16:36:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298914

Log:
- Replaced 'zend_hash_find' to 'zend_hash_quick_find' on zend_hash_compare() 
function

Changed paths:
U   php/php-src/branches/PHP_5_2/Zend/zend_hash.c
U   php/php-src/branches/PHP_5_3/Zend/zend_hash.c
U   php/php-src/trunk/Zend/zend_hash.c

Modified: php/php-src/branches/PHP_5_2/Zend/zend_hash.c
===
--- php/php-src/branches/PHP_5_2/Zend/zend_hash.c   2010-05-03 16:31:27 UTC 
(rev 298913)
+++ php/php-src/branches/PHP_5_2/Zend/zend_hash.c   2010-05-03 16:36:04 UTC 
(rev 298914)
@@ -1379,7 +1379,7 @@
return 1;
}
} else { /* string index */
-   if (zend_hash_find(ht2, p1-arKey, 
p1-nKeyLength, pData2)==FAILURE) {
+   if (zend_hash_quick_find(ht2, p1-arKey, 
p1-nKeyLength, p1-h, pData2)==FAILURE) {
HASH_UNPROTECT_RECURSION(ht1);
HASH_UNPROTECT_RECURSION(ht2);
return 1;

Modified: php/php-src/branches/PHP_5_3/Zend/zend_hash.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_hash.c   2010-05-03 16:31:27 UTC 
(rev 298913)
+++ php/php-src/branches/PHP_5_3/Zend/zend_hash.c   2010-05-03 16:36:04 UTC 
(rev 298914)
@@ -1455,7 +1455,7 @@
return 1;
}
} else { /* string index */
-   if (zend_hash_find(ht2, p1-arKey, 
p1-nKeyLength, pData2)==FAILURE) {
+   if (zend_hash_quick_find(ht2, p1-arKey, 
p1-nKeyLength, p1-h, pData2)==FAILURE) {
HASH_UNPROTECT_RECURSION(ht1);
HASH_UNPROTECT_RECURSION(ht2);
return 1;

Modified: php/php-src/trunk/Zend/zend_hash.c
===
--- php/php-src/trunk/Zend/zend_hash.c  2010-05-03 16:31:27 UTC (rev 298913)
+++ php/php-src/trunk/Zend/zend_hash.c  2010-05-03 16:36:04 UTC (rev 298914)
@@ -1477,7 +1477,7 @@
return 1;
}
} else { /* string index */
-   if (zend_hash_find(ht2, p1-arKey, 
p1-nKeyLength, pData2)==FAILURE) {
+   if (zend_hash_quick_find(ht2, p1-arKey, 
p1-nKeyLength, p1-h, pData2)==FAILURE) {
HASH_UNPROTECT_RECURSION(ht1);
HASH_UNPROTECT_RECURSION(ht2);
return 1;

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c trunk/ext/mysqlnd/mysqlnd.c trunk/e

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 17:07:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298917

Log:
Handle gracefully OOM in mysqlnd_mempool_create and up the stack

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	2010-05-03 16:48:18 UTC (rev 298916)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	2010-05-03 17:07:18 UTC (rev 298917)
@@ -2060,7 +2060,7 @@
 static MYSQLND_RES *
 MYSQLND_METHOD(mysqlnd_conn, use_result)(MYSQLND * const conn TSRMLS_DC)
 {
-	MYSQLND_RES *result;
+	MYSQLND_RES * result;

 	DBG_ENTER(mysqlnd_conn::use_result);
 	DBG_INF_FMT(conn=%llu, conn-thread_id);
@@ -2079,11 +2079,14 @@

 	MYSQLND_INC_CONN_STATISTIC(conn-stats, STAT_UNBUFFERED_SETS);

-	result = conn-current_result;
+	conn-current_result-conn = conn-m-get_reference(conn TSRMLS_CC);
+	result = conn-current_result-m.use_result(conn-current_result, FALSE TSRMLS_CC);
+
+	if (!result) {
+		conn-current_result-m.free_result(conn-current_result, TRUE TSRMLS_CC);
+	}
 	conn-current_result = NULL;
-	result-conn = conn-m-get_reference(conn TSRMLS_CC);
-
-	result = result-m.use_result(result, FALSE TSRMLS_CC);
+
 	DBG_RETURN(result);
 }
 /* }}} */
@@ -2112,10 +2115,11 @@

 	MYSQLND_INC_CONN_STATISTIC(conn-stats, STAT_BUFFERED_SETS);

-	result = conn-current_result;
+	result = conn-current_result-m.store_result(conn-current_result, conn, FALSE TSRMLS_CC);
+	if (!result) {
+		conn-current_result-m.free_result(conn-current_result, TRUE TSRMLS_CC);
+	}
 	conn-current_result = NULL;
-
-	result = result-m.store_result(result, conn, FALSE TSRMLS_CC);
 	DBG_RETURN(result);
 }
 /* }}} */

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c	2010-05-03 16:48:18 UTC (rev 298916)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c	2010-05-03 17:07:18 UTC (rev 298917)
@@ -156,13 +156,17 @@
 	/* We calloc, because we free(). We don't mnd_calloc()  for a reason. */
 	MYSQLND_MEMORY_POOL * ret = mnd_calloc(1, sizeof(MYSQLND_MEMORY_POOL));
 	DBG_ENTER(mysqlnd_mempool_create);
-
-	ret-free_size = ret-arena_size = arena_size ? arena_size : 0;
-	ret-refcount = 0;
-	/* OOM ? */
-	ret-arena = mnd_malloc(ret-arena_size);
-	ret-get_chunk = mysqlnd_mempool_get_chunk;
-
+	if (ret) {
+		ret-get_chunk = mysqlnd_mempool_get_chunk;
+		ret-free_size = ret-arena_size = arena_size ? arena_size : 0;
+		ret-refcount = 0;
+		/* OOM ? */
+		ret-arena = mnd_malloc(ret-arena_size);
+		if (!ret-arena) {
+			mysqlnd_mempool_destroy(ret TSRMLS_CC);
+			ret = NULL;
+		}
+	}
 	DBG_RETURN(ret);
 }
 /* }}} */

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2010-05-03 16:48:18 UTC (rev 298916)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2010-05-03 17:07:18 UTC (rev 298917)
@@ -841,23 +841,29 @@

 	SET_EMPTY_ERROR(result-conn-error_info);

+	result-result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC);
+	result-unbuf = mnd_ecalloc(1, sizeof(MYSQLND_RES_UNBUFFERED));
+	if (!result-result_set_memory_pool || !result-unbuf) {
+		goto oom;
+	}
+
 	if (ps == FALSE) {
 		result-type			= MYSQLND_RES_NORMAL;
 		result-m.fetch_row		= result-m.fetch_row_normal_unbuffered;
 		result-m.fetch_lengths	= mysqlnd_fetch_lengths_unbuffered;
+		result-m.row_decoder	= php_mysqlnd_rowp_read_text_protocol;
 		result-lengths			= mnd_ecalloc(result-field_count, sizeof(unsigned long));
-		result-m.row_decoder	= php_mysqlnd_rowp_read_text_protocol;
+		if (!result-lengths) {
+			goto oom;
+		}
 	} else {
 		result-type			= MYSQLND_RES_PS_UNBUF;
 		/* result-m.fetch_row() will be set in mysqlnd_ps.c */
 		result-m.fetch_lengths	= NULL; /* makes no sense */
+		result-m.row_decoder	= php_mysqlnd_rowp_read_binary_protocol;
 		result-lengths 		= NULL;
-		result-m.row_decoder	= php_mysqlnd_rowp_read_binary_protocol;
 	}
-	result-unbuf = mnd_ecalloc(1, sizeof(MYSQLND_RES_UNBUFFERED));

-	result-result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC);
-
 	/*
 	  Will be freed in the mysqlnd_internal_free_result_contents() called
 	  by the resource destructor. mysqlnd_fetch_row_unbuffered() expects
@@ -865,6 +871,9 @@
 	*/
 	/* FALSE = non-persistent */
 	

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c branches/PHP_5_3/NEWS branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c trunk/sapi/apache2handl

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 17:47:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298919

Log:
- #51273, Content-length header is limited to 32bit integer with apache2/windows

Bug: http://bugs.php.net/51273 (Open) Faultstring property does not exist when 
the faultstring is empty
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
U   php/php-src/trunk/sapi/apache2handler/sapi_apache2.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-05-03 17:47:58 UTC (rev 298919)
@@ -18,6 +18,8 @@
 - Fixed a possible arbitrary memory access inside sqlite extension. Reported
   by Mateusz Kocielski. (Ilia)

+- Fixed bug #51723 (Content-length header is limited to 32bit integer with
+  Apache2 on Windows). (Pierre)
 - Fixed bug #51671 (imagefill does not work correctly for small images).
   (Pierre)
 - Fixed bug #51670 (getColumnMeta causes segfault when re-executing query

Modified: php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c 
2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c 
2010-05-03 17:47:58 UTC (rev 298919)
@@ -110,7 +110,15 @@
}
ctx-content_type = estrdup(val);
} else if (!strcasecmp(sapi_header-header, content-length)) {
-   ap_set_content_length(ctx-r, strtol(val, (char **)NULL, 10));
+#ifdef PHP_WINDOWS
+# ifdef APR_HAS_LARGE_FILES
+   ap_set_content_length(ctx-r, (apr_off_t) _strtoui64(val, (char 
**)NULL, 10));
+# else
+   ap_set_content_length(ctx-r, (apr_off_t) strtol(val, (char 
**)NULL, 10));
+# endif
+#else
+   ap_set_content_length(ctx-r, (apr_off_t) strtol(val, (char 
**)NULL, 10));
+#endif
} else if (sapi_header-replace) {
apr_table_set(ctx-r-headers_out, sapi_header-header, val);
} else {

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-05-03 17:47:58 UTC (rev 298919)
@@ -37,6 +37,8 @@
   requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
 - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (Clément LECIGNE, Stas)

+- Fixed bug #51723 (Content-length header is limited to 32bit integer with
+  Apache2 on Windows). (Pierre)
 - Fixed bug #51690 (Phar::setStub looks for case-sensitive
   __HALT_COMPILER()). (Ilia)
 - Fixed bug #51688 (ini per dir crashes when invalid document root  are given).

Modified: php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c 
2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c 
2010-05-03 17:47:58 UTC (rev 298919)
@@ -120,7 +120,15 @@
}
ctx-content_type = estrdup(val);
} else if (!strcasecmp(sapi_header-header, 
content-length)) {
-   ap_set_content_length(ctx-r, strtol(val, (char 
**)NULL, 10));
+#ifdef PHP_WINDOWS
+# ifdef APR_HAS_LARGE_FILES
+   ap_set_content_length(ctx-r, (apr_off_t) 
_strtoui64(val, (char **)NULL, 10));
+# else
+   ap_set_content_length(ctx-r, (apr_off_t) 
strtol(val, (char **)NULL, 10));
+# endif
+#else
+   ap_set_content_length(ctx-r, (apr_off_t) 
strtol(val, (char **)NULL, 10));
+#endif
} else if (op == SAPI_HEADER_REPLACE) {
apr_table_set(ctx-r-headers_out, 
sapi_header-header, val);
} else {

Modified: php/php-src/trunk/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/trunk/sapi/apache2handler/sapi_apache2.c2010-05-03 
17:10:04 UTC (rev 298918)
+++ php/php-src/trunk/sapi/apache2handler/sapi_apache2.c2010-05-03 
17:47:58 UTC (rev 298919)
@@ -120,7 +120,15 @@
}
ctx-content_type = estrdup(val);
} else if (!strcasecmp(sapi_header-header, 
content-length)) {
-   ap_set_content_length(ctx-r, strtol(val, (char 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c trunk/ext/mysqlnd/mysqlnd_ps.c trunk/ext/mysqlnd/mysqlnd_result.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 18:50:47 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298920

Log:
Handle OOM stemming from mysqlnd_result_init in the same
function and up the stack.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c	2010-05-03 17:47:58 UTC (rev 298919)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c	2010-05-03 18:50:47 UTC (rev 298920)
@@ -156,20 +156,35 @@
 	SET_EMPTY_ERROR(stmt-conn-error_info);
 	MYSQLND_INC_CONN_STATISTIC(conn-stats, STAT_BUFFERED_SETS);

-	result = mysqlnd_result_init(stmt-result-field_count, stmt-persistent TSRMLS_CC);
+	do {
+		result = mysqlnd_result_init(stmt-result-field_count, stmt-persistent TSRMLS_CC);
+		if (!result) {
+			SET_OOM_ERROR(stmt-conn-error_info);
+			break;
+		}

-	result-meta = stmt-result-meta-m-clone_metadata(stmt-result-meta, FALSE TSRMLS_CC);
+		result-meta = stmt-result-meta-m-clone_metadata(stmt-result-meta, FALSE TSRMLS_CC);
+		if (!result-meta) {
+			SET_OOM_ERROR(stmt-conn-error_info);
+			break;
+		}

-	if ((result = result-m.store_result(result, conn, TRUE TSRMLS_CC))) {
-		stmt-upsert_status.affected_rows = result-stored_data-row_count;
-		stmt-state = MYSQLND_STMT_PREPARED;
-		result-type = MYSQLND_RES_PS_BUF;
-	} else {
-		stmt-error_info = conn-error_info;
-		stmt-state = MYSQLND_STMT_PREPARED;
+		if ((result = result-m.store_result(result, conn, TRUE TSRMLS_CC))) {
+			stmt-upsert_status.affected_rows = result-stored_data-row_count;
+			stmt-state = MYSQLND_STMT_PREPARED;
+			result-type = MYSQLND_RES_PS_BUF;
+		} else {
+			stmt-error_info = conn-error_info;
+			stmt-state = MYSQLND_STMT_PREPARED;
+			break;
+		}
+		DBG_RETURN(result);
+	} while (0);
+
+	if (result) {
+		result-m.free_result(result, TRUE TSRMLS_CC);
 	}
-
-	DBG_RETURN(result);
+	DBG_RETURN(NULL);
 }
 /* }}} */

@@ -366,6 +381,10 @@
 	*/
 	if (stmt_to_prepare-field_count) {
 		MYSQLND_RES * result = mysqlnd_result_init(stmt_to_prepare-field_count, stmt_to_prepare-persistent TSRMLS_CC);
+		if (!result) {
+			SET_OOM_ERROR(stmt-conn-error_info);
+			goto fail;
+		}
 		/* Allocate the result now as it is needed for the reading of metadata */
 		stmt_to_prepare-result = result;

@@ -374,7 +393,8 @@
 		result-type = MYSQLND_RES_PS_BUF;

 		if (FAIL == result-m.read_result_metadata(result, stmt_to_prepare-conn TSRMLS_CC) ||
-			FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare TSRMLS_CC)) {
+			FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare TSRMLS_CC))
+		{
 			goto fail;
 		}
 	}
@@ -1655,15 +1675,32 @@
 	  In the meantime we don't need a zval cache reference for this fake
 	  result set, so we don't get one.
 	*/
-	result = mysqlnd_result_init(stmt-field_count, stmt-persistent TSRMLS_CC);
-	result-type = MYSQLND_RES_NORMAL;
-	result-m.fetch_row = result-m.fetch_row_normal_unbuffered;
-	result-unbuf = mnd_ecalloc(1, sizeof(MYSQLND_RES_UNBUFFERED));
-	result-unbuf-eof_reached = TRUE;
-	result-meta = stmt-result-meta-m-clone_metadata(stmt-result-meta, FALSE TSRMLS_CC);
+	do {
+		result = mysqlnd_result_init(stmt-field_count, stmt-persistent TSRMLS_CC);
+		if (!result) {
+			break;
+		}
+		result-type = MYSQLND_RES_NORMAL;
+		result-m.fetch_row = result-m.fetch_row_normal_unbuffered;
+		result-unbuf = mnd_ecalloc(1, sizeof(MYSQLND_RES_UNBUFFERED));
+		if (!result-unbuf) {
+			break;
+		}
+		result-unbuf-eof_reached = TRUE;
+		result-meta = stmt-result-meta-m-clone_metadata(stmt-result-meta, FALSE TSRMLS_CC);
+		if (!result-meta) {
+			break;
+		}

-	DBG_INF_FMT(result=%p, result);
-	DBG_RETURN(result);
+		DBG_INF_FMT(result=%p, result);
+		DBG_RETURN(result);
+	} while (0);
+
+	SET_OOM_ERROR(stmt-conn-error_info);
+	if (result) {
+		result-m.free_result(result, TRUE TSRMLS_CC);
+	}
+	DBG_RETURN(NULL);
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2010-05-03 17:47:58 UTC (rev 298919)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2010-05-03 18:50:47 UTC (rev 298920)
@@ -353,6 +353,7 @@
 	MYSQLND_STMT_DATA * stmt = s ? s-data:NULL;
 	enum_func_status ret;
 	MYSQLND_PACKET_RSET_HEADER * rset_header;
+	MYSQLND_PACKET_EOF * fields_eof;

 	DBG_ENTER(mysqlnd_query_read_result_set_header);
 	DBG_INF_FMT(stmt=%d, stmt? stmt-stmt_id:0);
@@ -420,8 +421,7 @@
 ret = PASS;
 MYSQLND_INC_CONN_STATISTIC(conn-stats, STAT_NON_RSET_QUERY);
 break;
-			default:{			/* Result set */
-MYSQLND_PACKET_EOF * fields_eof;
+			default: do {			/* Result set */
 	

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c trunk/ext/mysqlnd/mysqlnd_result.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 19:02:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298922

Log:
Handle OOM in mysqlnd_fetch_row_unbuffered_c()

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-03 
18:53:10 UTC (rev 298921)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-03 
19:02:48 UTC (rev 298922)
@@ -646,27 +646,30 @@
  
result-conn-stats TSRMLS_CC);

retrow = mnd_malloc(result-field_count * sizeof(char 
*));
+   if (retrow) {
+   for (i = 0; i  field_count; i++, field++, 
zend_hash_key++) {
+   zval *data = 
result-unbuf-last_row_data[i];
+   unsigned int len;

-   for (i = 0; i  field_count; i++, field++, 
zend_hash_key++) {
-   zval *data = result-unbuf-last_row_data[i];
-   unsigned int len;
+   if (Z_TYPE_P(data) != IS_NULL) {
+   convert_to_string(data);
+   retrow[i] = Z_STRVAL_P(data);
+   len = Z_STRLEN_P(data);
+   } else {
+   retrow[i] = NULL;
+   len = 0;
+   }

-   if (Z_TYPE_P(data) != IS_NULL) {
-   convert_to_string(data);
-   retrow[i] = Z_STRVAL_P(data);
-   len = Z_STRLEN_P(data);
-   } else {
-   retrow[i] = NULL;
-   len = 0;
-   }
+   if (lengths) {
+   lengths[i] = len;
+   }

-   if (lengths) {
-   lengths[i] = len;
+   if (field-max_length  len) {
+   field-max_length = len;
+   }
}
-
-   if (field-max_length  len) {
-   field-max_length = len;
-   }
+   } else {
+   SET_OOM_ERROR(result-conn-error_info);
}
}
} else if (ret == FAIL) {

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-03 18:53:10 UTC 
(rev 298921)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-03 19:02:48 UTC 
(rev 298922)
@@ -646,27 +646,30 @@
  
result-conn-stats TSRMLS_CC);

retrow = mnd_malloc(result-field_count * sizeof(char 
*));
+   if (retrow) {
+   for (i = 0; i  field_count; i++, field++, 
zend_hash_key++) {
+   zval *data = 
result-unbuf-last_row_data[i];
+   unsigned int len;

-   for (i = 0; i  field_count; i++, field++, 
zend_hash_key++) {
-   zval *data = result-unbuf-last_row_data[i];
-   unsigned int len;
+   if (Z_TYPE_P(data) != IS_NULL) {
+   convert_to_string(data);
+   retrow[i] = Z_STRVAL_P(data);
+   len = Z_STRLEN_P(data);
+   } else {
+   retrow[i] = NULL;
+   len = 0;
+   }

-   if (Z_TYPE_P(data) != IS_NULL) {
-   convert_to_string(data);
-   retrow[i] = Z_STRVAL_P(data);
-   len = Z_STRLEN_P(data);
-   } else {
-  

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/sapi/apache2handler/ sapi_apache2.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 19:08:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298924

Log:
- revert as vc6 does not support strtoi64, update to 5.3 will be the fix

Changed paths:
U   php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c

Modified: php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c 
2010-05-03 19:05:27 UTC (rev 298923)
+++ php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c 
2010-05-03 19:08:26 UTC (rev 298924)
@@ -110,15 +110,7 @@
}
ctx-content_type = estrdup(val);
} else if (!strcasecmp(sapi_header-header, content-length)) {
-#ifdef PHP_WINDOWS
-# ifdef APR_HAS_LARGE_FILES
-   ap_set_content_length(ctx-r, (apr_off_t) _strtoui64(val, (char 
**)NULL, 10));
-# else
ap_set_content_length(ctx-r, (apr_off_t) strtol(val, (char 
**)NULL, 10));
-# endif
-#else
-   ap_set_content_length(ctx-r, (apr_off_t) strtol(val, (char 
**)NULL, 10));
-#endif
} else if (sapi_header-replace) {
apr_table_set(ctx-r-headers_out, sapi_header-header, val);
} else {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c trunk/ext/mysqlnd/mysqlnd_result.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 19:09:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298925

Log:
Handle OOM in mysqlnd_fetch_row_buffered_c()

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-03 
19:08:26 UTC (rev 298924)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-03 
19:09:45 UTC (rev 298925)
@@ -939,20 +939,23 @@
}
}

+   set-data_cursor += result-meta-field_count;
+   
MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF);
+
ret = mnd_malloc(result-field_count * sizeof(char *));
+   if (ret) {
+   for (i = 0; i  result-field_count; i++, field++, 
zend_hash_key++) {
+   zval *data = current_row[i];

-   for (i = 0; i  result-field_count; i++, field++, 
zend_hash_key++) {
-   zval *data = current_row[i];
-
-   if (Z_TYPE_P(data) != IS_NULL) {
-   convert_to_string(data);
-   ret[i] = Z_STRVAL_P(data);
-   } else {
-   ret[i] = NULL;
+   if (Z_TYPE_P(data) != IS_NULL) {
+   convert_to_string(data);
+   ret[i] = Z_STRVAL_P(data);
+   } else {
+   ret[i] = NULL;
+   }
}
}
-   set-data_cursor += result-meta-field_count;
-   
MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF);
+   /* there is no conn handle in this function thus we can't set 
OOM in error_info */
} else {
set-data_cursor = NULL;
DBG_INF(EOF reached);

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-03 19:08:26 UTC 
(rev 298924)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-03 19:09:45 UTC 
(rev 298925)
@@ -939,20 +939,23 @@
}
}

+   set-data_cursor += result-meta-field_count;
+   
MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF);
+
ret = mnd_malloc(result-field_count * sizeof(char *));
+   if (ret) {
+   for (i = 0; i  result-field_count; i++, field++, 
zend_hash_key++) {
+   zval *data = current_row[i];

-   for (i = 0; i  result-field_count; i++, field++, 
zend_hash_key++) {
-   zval *data = current_row[i];
-
-   if (Z_TYPE_P(data) != IS_NULL) {
-   convert_to_string(data);
-   ret[i] = Z_STRVAL_P(data);
-   } else {
-   ret[i] = NULL;
+   if (Z_TYPE_P(data) != IS_NULL) {
+   convert_to_string(data);
+   ret[i] = Z_STRVAL_P(data);
+   } else {
+   ret[i] = NULL;
+   }
}
}
-   set-data_cursor += result-meta-field_count;
-   
MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF);
+   /* there is no conn handle in this function thus we can't set 
OOM in error_info */
} else {
set-data_cursor = NULL;
DBG_INF(EOF reached);

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/oci8/ oci8.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 19:29:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298927

Log:
- fix build (declaration must be first)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-05-03 19:28:19 UTC 
(rev 298926)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-05-03 19:29:05 UTC 
(rev 298927)
@@ -1638,10 +1638,10 @@
  */
 int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, 
ub2 *error_offset TSRMLS_DC)
 {
+   sword errstatus;
+
*sqltext = NULL;
*error_offset = 0;
-   sword errstatus;
-
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement-stmt, 
OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, 
statement-err));

if (errstatus != OCI_SUCCESS) {

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

[PHP-CVS] svn: /php/php-src/trunk/ext/oci8/ oci8.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 19:31:50 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298928

Log:
- fix build (declaration must be first)

Changed paths:
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2010-05-03 19:29:05 UTC (rev 298927)
+++ php/php-src/trunk/ext/oci8/oci8.c   2010-05-03 19:31:50 UTC (rev 298928)
@@ -1638,10 +1638,10 @@
  */
 int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, 
ub2 *error_offset TSRMLS_DC)
 {
+   sword errstatus;
+
*sqltext = NULL;
*error_offset = 0;
-   sword errstatus;
-
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement-stmt, 
OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, 
statement-err));

if (errstatus != OCI_SUCCESS) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c trunk/ext/mysqlnd/mysqlnd_result.c

2010-05-03 Thread Andrey Hristov
andrey   Mon, 03 May 2010 19:32:07 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298929

Log:
Handle OOM in mysqlnd_res::store_result_fetch_data

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-03 
19:31:50 UTC (rev 298928)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-03 
19:32:07 UTC (rev 298929)
@@ -1080,8 +1080,18 @@
conn-thread_id, binary_protocol, to_cache);

result-stored_data = set = mnd_pecalloc(1, 
sizeof(MYSQLND_RES_BUFFERED), to_cache);
+   if (!set) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   goto end;
+   }
if (free_rows) {
set-row_buffers = mnd_pemalloc(free_rows * 
sizeof(MYSQLND_MEMORY_POOL_CHUNK *), to_cache);
+   if (!set-row_buffers) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   goto end;
+   }
}
set-persistent = to_cache;
set-references = 1;
@@ -1091,6 +1101,11 @@

/* non-persistent */
row_packet = conn-protocol-m.get_row_packet(conn-protocol, FALSE 
TSRMLS_CC);
+   if (!row_packet) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   goto end;
+   }
row_packet-result_set_memory_pool = result-result_set_memory_pool;
row_packet-field_count = meta-field_count;
row_packet-binary_protocol = binary_protocol;
@@ -1103,10 +1118,17 @@
while (FAIL != (ret = PACKET_READ(row_packet, conn))  
!row_packet-eof) {
if (!free_rows) {
uint64_t total_allocated_rows = free_rows = next_extend 
= next_extend * 11 / 10; /* extend with 10% */
+   MYSQLND_MEMORY_POOL_CHUNK ** new_row_buffers;
total_allocated_rows += set-row_count;
-   set-row_buffers = mnd_perealloc(set-row_buffers,
-   
 total_allocated_rows * sizeof(MYSQLND_MEMORY_POOL_CHUNK *),
-   
 set-persistent);
+   new_row_buffers = mnd_perealloc(set-row_buffers,
+   
total_allocated_rows * sizeof(MYSQLND_MEMORY_POOL_CHUNK *),
+   
set-persistent);
+   if (!new_row_buffers) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   goto end;
+   }
+   set-row_buffers = new_row_buffers;
}
free_rows--;
set-row_buffers[set-row_count] = row_packet-row_buffer;
@@ -1128,6 +1150,11 @@
if (set-row_count) {
/* if pecalloc is used valgrind barks gcc version 4.3.1 
20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) */
set-data = mnd_pemalloc(set-row_count * meta-field_count * 
sizeof(zval *), to_cache);
+   if (!set-data) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   goto end;
+   }
memset(set-data, 0, set-row_count * meta-field_count * 
sizeof(zval *));
}

@@ -1163,6 +1190,7 @@
/* libmysql's documentation says it should be so for SELECT 
statements */
conn-upsert_status.affected_rows = set-row_count;
}
+end:
PACKET_FREE(row_packet);

DBG_INF_FMT(ret=%s row_count=%u warnings=%u server_status=%u, ret == 
PASS? PASS:FAIL,

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-03 19:31:50 UTC 
(rev 298928)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-03 19:32:07 UTC 
(rev 298929)
@@ -1080,8 +1080,18 @@
conn-thread_id, binary_protocol, to_cache);

result-stored_data = set = mnd_pecalloc(1, 
sizeof(MYSQLND_RES_BUFFERED), to_cache);
+   if (!set) {
+   SET_OOM_ERROR(conn-error_info);
+   ret = FAIL;
+   goto end;
+   }
if (free_rows) {
set-row_buffers = mnd_pemalloc(free_rows * 
sizeof(MYSQLND_MEMORY_POOL_CHUNK *), to_cache);
+  

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c trunk/sapi/apache2handler/sapi_apache2.c

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 19:51:59 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298930

Log:
- revert fix for #51723 in 5.2, vc6 does not support strtoi64, use builtin 
functioon in 5.3 (trunk is vc9+ only)

Bug: http://bugs.php.net/51723 (Closed) Content-length header is limited to 
32bit integer
  
Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
U   php/php-src/trunk/sapi/apache2handler/sapi_apache2.c

Modified: php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c 
2010-05-03 19:32:07 UTC (rev 298929)
+++ php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c 
2010-05-03 19:51:59 UTC (rev 298930)
@@ -53,6 +53,10 @@

 #include php_apache.h

+#if _MSC_VER = 1300
+# include win32/php_strtoi64.h
+#endif
+
 /* UnixWare and Netware define shutdown to _shutdown, which causes problems 
later
  * on when using a structure member named shutdown. Since this source
  * file does not use the system call shutdown, it is safe to #undef it.K

Modified: php/php-src/trunk/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/trunk/sapi/apache2handler/sapi_apache2.c2010-05-03 
19:32:07 UTC (rev 298929)
+++ php/php-src/trunk/sapi/apache2handler/sapi_apache2.c2010-05-03 
19:51:59 UTC (rev 298930)
@@ -53,6 +53,10 @@

 #include php_apache.h

+#if _MSC_VER = 1300
+# include win32/php_strtoi64.h
+#endif
+
 /* UnixWare and Netware define shutdown to _shutdown, which causes problems 
later
  * on when using a structure member named shutdown. Since this source
  * file does not use the system call shutdown, it is safe to #undef it.K
@@ -120,7 +124,7 @@
}
ctx-content_type = estrdup(val);
} else if (!strcasecmp(sapi_header-header, 
content-length)) {
-#ifdef PHP_WINDOWS
+#ifdef PHP_WIN32
 # ifdef APR_HAS_LARGE_FILES
ap_set_content_length(ctx-r, (apr_off_t) 
_strtoui64(val, (char **)NULL, 10));
 # else

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ NEWS

2010-05-03 Thread Pierre Joye
pajoye   Mon, 03 May 2010 19:53:02 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298931

Log:
- revert #51273

Bug: http://bugs.php.net/51273 (Open) Faultstring property does not exist when 
the faultstring is empty
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-05-03 19:51:59 UTC (rev 298930)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-05-03 19:53:02 UTC (rev 298931)
@@ -18,8 +18,6 @@
 - Fixed a possible arbitrary memory access inside sqlite extension. Reported
   by Mateusz Kocielski. (Ilia)

-- Fixed bug #51723 (Content-length header is limited to 32bit integer with
-  Apache2 on Windows). (Pierre)
 - Fixed bug #51671 (imagefill does not work correctly for small images).
   (Pierre)
 - Fixed bug #51670 (getColumnMeta causes segfault when re-executing query

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c

2010-05-03 Thread Stefan Marr
gron Mon, 03 May 2010 22:08:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298935

Log:
Changed naming of traits-related helper functions (suggested by Derick), added 
missing static qualifiers.

Changed paths:
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2010-05-03 22:08:06 UTC (rev 
298934)
+++ php/php-src/trunk/Zend/zend_compile.c   2010-05-03 22:08:09 UTC (rev 
298935)
@@ -3231,7 +3231,7 @@
 }
 /* }}} */

-static int _merge_functions(zend_function *fn TSRMLS_DC, int num_args, va_list 
args, zend_hash_key *hash_key) /* {{{ */
+static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int 
num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
 {
size_t current;
size_t i;
@@ -3320,7 +3320,7 @@

 /* {{{ Originates from php_runkit_function_copy_ctor
Duplicate structures in an op_array where necessary to make an outright 
duplicate */
-void _duplicate_function(zend_function *fe, char *newname)
+static void zend_traits_duplicate_function(zend_function *fe, char *newname)
 {
zend_literal *literals_copy;
zend_compiled_variable *dupvars;
@@ -3405,7 +3405,7 @@
 }
 /*  */

-static int _merge_functions_to_class(zend_function *fn TSRMLS_DC, int 
num_args, va_list args, zend_hash_key *hash_key)
+static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, 
int num_args, va_list args, zend_hash_key *hash_key)
 {
zend_class_entry *ce = va_arg(args, zend_class_entry*);
int add = 0;
@@ -3465,7 +3465,7 @@
return ZEND_HASH_APPLY_REMOVE;
 }

-static int _copy_functions(zend_function *fn TSRMLS_DC, int num_args, va_list 
args, zend_hash_key *hash_key)
+static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int 
num_args, va_list args, zend_hash_key *hash_key)
 {
HashTable* target;
zend_trait_alias** aliases;
@@ -3492,7 +3492,7 @@
  fn-common.function_name, fnname_len) == 0)) {
if (aliases[i]-alias) {
fn_copy = *fn;
-   _duplicate_function(fn_copy, 
estrndup(aliases[i]-alias, aliases[i]-alias_len));
+   
zend_traits_duplicate_function(fn_copy, estrndup(aliases[i]-alias, 
aliases[i]-alias_len));

if (aliases[i]-modifiers) { /* if it 
is 0, no modifieres has been changed */
fn_copy.common.fn_flags = 
aliases[i]-modifiers;
@@ -3521,7 +3521,7 @@
if (zend_hash_find(exclude_table, lcname, fnname_len, dummy) == 
FAILURE) {
/* is not in hashtable, thus, function is not to be excluded */
fn_copy = *fn;
-   _duplicate_function(fn_copy, 
estrndup(fn-common.function_name, fnname_len));
+   zend_traits_duplicate_function(fn_copy, 
estrndup(fn-common.function_name, fnname_len));

/* apply aliases which are not qualified by a class name, or 
which have not alias name, just setting visibility */
/* TODO: i am still not sure, that there will be no 
ambigousities... */
@@ -3538,7 +3538,7 @@
char* lcname2;
zend_function fn_copy2 = *fn;

-   _duplicate_function(fn_copy2, 
estrndup(aliases[i]-alias, aliases[i]-alias_len));
+   
zend_traits_duplicate_function(fn_copy2, estrndup(aliases[i]-alias, 
aliases[i]-alias_len));

if (aliases[i]-modifiers) { /* 
if it is 0, no modifieres has been changed */

fn_copy2.common.fn_flags = aliases[i]-modifiers;
@@ -3583,12 +3583,12 @@
 /**
 * Copies function table entries to target function table with applied aliasing
 */
-void copy_trait_function_table(HashTable *target, HashTable *source, 
zend_trait_alias** aliases, HashTable* exclude_table TSRMLS_DC) {
-   zend_hash_apply_with_arguments(source TSRMLS_CC, 
(apply_func_args_t)_copy_functions, 3, /* 3 is number of args for apply_func */
+static void zend_traits_copy_trait_function_table(HashTable *target, HashTable 
*source, zend_trait_alias** aliases, HashTable* exclude_table TSRMLS_DC) {
+   zend_hash_apply_with_arguments(source TSRMLS_CC, 
(apply_func_args_t)zend_traits_copy_functions, 3, /* 3 is number of args for 
apply_func */
target, aliases, exclude_table);
 }

-void init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) 
/* {{{ */
 {
size_t i,