summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_warning.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2011-03-17 10:28:53 +0000
committerAndrey Hristov <andrey@php.net>2011-03-17 10:28:53 +0000
commitd903915f938c33592b20bdba5f27a4aba01c3c8d (patch)
tree24a5caebb0702cb6e752a548aefcebb311659080 /ext/mysqli/mysqli_warning.c
parentb60e4fe4f091dcff2b55072688ab1e3126f86df8 (diff)
downloadphp-git-d903915f938c33592b20bdba5f27a4aba01c3c8d.tar.gz
Fix for bug #54221 mysqli::get_warnings segfault when used in multi queries
Diffstat (limited to 'ext/mysqli/mysqli_warning.c')
-rw-r--r--ext/mysqli/mysqli_warning.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index 09fa5b3510..ee815121b3 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -197,7 +197,7 @@ PHP_METHOD(mysqli_warning, next)
MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, &mysqli_warning, "mysqli_warning", MYSQLI_STATUS_VALID);
- if (w->next) {
+ if (w && w->next) {
w = w->next;
((MYSQLI_RESOURCE *)(obj->ptr))->ptr = w;
RETURN_TRUE;