summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorDan Kalowsky <kalowsky@php.net>2002-07-31 13:50:51 +0000
committerDan Kalowsky <kalowsky@php.net>2002-07-31 13:50:51 +0000
commitcc491407de426563ec6a8723cf2339dc2b73a087 (patch)
tree6d688a678fb7b780a50bd582cca397590717b571 /ext/odbc/php_odbc.c
parent9fe39b96049ce5ef486d69e6ebdabb67c3a21a97 (diff)
downloadphp-git-cc491407de426563ec6a8723cf2339dc2b73a087.tar.gz
Just adding in an error check that seems to work here well.
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c5
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;