mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix GH-17837: ::getColumnMeta() on unexecuted statement segfaults
We cannot properly get the column meta data of a statement which has been prepared, but has not yet been executed. As such we bail out early, reporting failure. Closes GH-17850.
This commit is contained in:
parent
86f5a31e5b
commit
260e0e9bd3
3 changed files with 19 additions and 1 deletions
|
@ -305,7 +305,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
|
|||
const char *str;
|
||||
zval flags;
|
||||
|
||||
if (!S->stmt) {
|
||||
if (!S->stmt || !stmt->executed) {
|
||||
return FAILURE;
|
||||
}
|
||||
if(colno >= sqlite3_column_count(S->stmt)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue