summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-01-27 14:41:48 +0000
committerAntony Dovgal <tony2001@php.net>2005-01-27 14:41:48 +0000
commit6ffd569410137736618c3fca132d94b26126262c (patch)
treee0ab769a9b97cf2f342ebd04ea587653b9577e1d /ext/mysqli/mysqli.c
parent71489199400c1f17b4743e1322af7ffd2bd43be0 (diff)
downloadphp-git-6ffd569410137736618c3fca132d94b26126262c.tar.gz
MFB: fix leak in mysqli_fetch_array()
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index e1542300c9..aa94fb2a70 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -777,6 +777,11 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result");
+ if ((fetchtype & MYSQLI_BOTH) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
+ RETURN_FALSE;
+ }
+
if (!(row = mysql_fetch_row(result))) {
RETURN_NULL();
}