diff options
Diffstat (limited to 'ext/odbc/php_odbc.c')
| -rw-r--r-- | ext/odbc/php_odbc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index bf5a613f7f..dac5901b8c 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1631,6 +1631,11 @@ PHP_FUNCTION(odbc_result) /* get field index if the field parameter was a string */ if (field != NULL) { + if (result->values == NULL) { + php_error(E_WARNING, "Result set contains no data"); + RETURN_FALSE; + } + for(i = 0; i < result->numcols; i++) { if (!strcasecmp(result->values[i].name, field)) { field_ind = i; |
