diff options
| author | Yasuo Ohgaki <yohgaki@php.net> | 2002-10-19 04:46:19 +0000 |
|---|---|---|
| committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-10-19 04:46:19 +0000 |
| commit | 29a53a47f6fa8cee9809cc3d766bb81373093a80 (patch) | |
| tree | 0eb4f01871aa0f598169b45c10e43f57bedff833 /ext/pgsql/pgsql.c | |
| parent | 98ab76d23c6985d4fd903b67c7bf71249eb77788 (diff) | |
| download | php-git-29a53a47f6fa8cee9809cc3d766bb81373093a80.tar.gz | |
Skip field when there is obvious error.
Fixed freeing of wrong zval.
Diffstat (limited to 'ext/pgsql/pgsql.c')
| -rw-r--r-- | ext/pgsql/pgsql.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index cde7b2ba95..48bcc26291 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3356,6 +3356,8 @@ PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval 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 @@ PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval 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: |
