Initalize return_value before use

Otherwise we likely segfault[1].  We fix the same issue for
PDO_Firebird as well.

[1] <38267250/job/6y3ngn1k6ryxx6j3 (L9783)>

Closes GH-6785.
This commit is contained in:
Christoph M. Becker 2021-03-17 15:09:18 +01:00
parent 92a969421c
commit 128082c86f
2 changed files with 2 additions and 0 deletions

View file

@ -243,6 +243,7 @@ static int firebird_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval
} }
} }
array_init(return_value);
add_assoc_long(return_value, "pdo_type", param_type); add_assoc_long(return_value, "pdo_type", param_type);
return 1; return 1;
} }

View file

@ -627,6 +627,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
static int odbc_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value) static int odbc_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{ {
array_init(return_value);
add_assoc_long(return_value, "pdo_type", PDO_PARAM_STR); add_assoc_long(return_value, "pdo_type", PDO_PARAM_STR);
return 1; return 1;
} }