felipe          Sat Oct 11 19:05:30 2008 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/pdo_pgsql      pgsql_statement.c 
  Log:
  MFH:
  - Fixed bug #46249 (pdo_pgsql always fill in NULL for empty BLOB)
  - Fixed bug #46274 (pdo_pgsql - Segfault when using 
PDO::ATTR_STRINGIFY_FETCHES and blob)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.31.2.12.2.11&r2=1.31.2.12.2.12&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.11 
php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.12
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.11      Tue Feb 26 
00:14:04 2008
+++ php-src/ext/pdo_pgsql/pgsql_statement.c     Sat Oct 11 19:05:30 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pgsql_statement.c,v 1.31.2.12.2.11 2008/02/26 00:14:04 iliaa Exp $ */
+/* $Id: pgsql_statement.c,v 1.31.2.12.2.12 2008/10/11 19:05:30 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -293,10 +293,16 @@
                                                                
S->param_types[param->paramno] = OIDOID;
                                                                return 1;
                                                        } else {
+                                                               int len;
+                                                               
                                                                
SEPARATE_ZVAL_IF_NOT_REF(&param->parameter);
                                                                
Z_TYPE_P(param->parameter) = IS_STRING;
-                                                               
Z_STRLEN_P(param->parameter) = php_stream_copy_to_mem(stm,
-                                                                               
&Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 0);
+                                                               
+                                                               if ((len = 
php_stream_copy_to_mem(stm, &Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 
0)) > 0) {
+                                                                       
Z_STRLEN_P(param->parameter) = len;
+                                                               } else {
+                                                                       
ZVAL_EMPTY_STRING(param->parameter);
+                                                               }
                                                        }
                                                } else {
                                                        /* expected a stream 
resource */



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

Reply via email to