tony2001                Fri Jan 20 11:01:36 2006 UTC

  Modified files:              
    /php-src/ext/oci8   oci8_statement.c 
  Log:
  fix #36096 (oci_result() returns garbage after oci_fetch() failed)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.13&r2=1.14&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.13 
php-src/ext/oci8/oci8_statement.c:1.14
--- php-src/ext/oci8/oci8_statement.c:1.13      Sun Jan  1 13:09:52 2006
+++ php-src/ext/oci8/oci8_statement.c   Fri Jan 20 11:01:36 2006
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_statement.c,v 1.13 2006/01/01 13:09:52 sniper Exp $ */
+/* $Id: oci8_statement.c,v 1.14 2006/01/20 11:01:36 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -165,7 +165,6 @@
                        /* this is exactly what we requested */
                        return 0;
                }
-               
                return 1;
        }
 
@@ -509,7 +508,7 @@
                                        outcol->storage_size4 *= 3;
                                        
                                        dynamic = OCI_DEFAULT;
-                                       buf = outcol->data = (text *) 
emalloc(outcol->storage_size4);
+                                       buf = outcol->data = (text *) 
ecalloc(1, outcol->storage_size4);
                                        break;
                        }
 
@@ -1020,6 +1019,10 @@
        if (!statement) {
                return NULL;
        }
+
+       if (!statement->has_data) {
+               return NULL;
+       }
        
        if (Z_TYPE_P(column_index) == IS_STRING) {
                column = php_oci_statement_get_column(statement, -1, 
Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC);

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

Reply via email to