yohgaki         Sat Oct 19 00:46:19 2002 EDT

  Modified files:              
    /php4/ext/pgsql     pgsql.c 
  Log:
  Skip field when there is obvious error.
  Fixed freeing of wrong zval.
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.238 php4/ext/pgsql/pgsql.c:1.239
--- php4/ext/pgsql/pgsql.c:1.238        Sat Oct 19 00:01:27 2002
+++ php4/ext/pgsql/pgsql.c      Sat Oct 19 00:46:19 2002
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: pgsql.c,v 1.238 2002/10/19 04:01:27 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.239 2002/10/19 04:46:19 yohgaki Exp $ */
 
 #include <stdlib.h>
 
@@ -3356,6 +3356,8 @@
                 zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&val, 
&pos) == SUCCESS;
                 zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos)) {
                skip_field = 0;
+               MAKE_STD_ZVAL(new_val);
+               
                if ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(values), 
&field, &field_len, &num_idx, 0, &pos)) == HASH_KEY_NON_EXISTANT) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get 
array key type");
                        err = 1;
@@ -3391,10 +3393,10 @@
                        err = 1;
                }
                if (err) {
+                       skip_field = 1; /* prevent adding invalid feild */
                        break;
                }
                
-               MAKE_STD_ZVAL(new_val);
                switch(php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type)))
                {
                        case PG_BOOL:



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

Reply via email to