From: Dan Kalowsky Date: Wed, 31 Jul 2002 13:50:51 +0000 (+0000) Subject: Just adding in an error check that seems to work here well. X-Git-Tag: dev~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc491407de426563ec6a8723cf2339dc2b73a087;p=php Just adding in an error check that seems to work here well. --- 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;