From cc491407de426563ec6a8723cf2339dc2b73a087 Mon Sep 17 00:00:00 2001 From: Dan Kalowsky Date: Wed, 31 Jul 2002 13:50:51 +0000 Subject: [PATCH] Just adding in an error check that seems to work here well. --- ext/odbc/php_odbc.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.50.1