diff options
author | Johannes Schlüter <johannes@php.net> | 2009-11-12 17:48:36 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2009-11-12 17:48:36 +0000 |
commit | b1997d6557739800df05ec4b869c5990ccd7cb72 (patch) | |
tree | 16c9c9c978160b2e8c6ae03ef2521f0f52baa7e4 | |
parent | 368e8230de9115c65dcdc4b60de144ea38d300ba (diff) | |
download | php-git-b1997d6557739800df05ec4b869c5990ccd7cb72.tar.gz |
Merge 290570 (Fix bug #49098). (Rasmus)
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/mysqli/mysqli_nonapi.c | 6 |
2 files changed, 6 insertions, 1 deletions
@@ -7,6 +7,7 @@ PHP NEWS elmerot dot se) - Fixed bug #49910 (no support for ././@LongLink for long filenames in phar tar support). (Greg) +- Fixed bug #49098 (mysqli segfault on error) (Rasmus) 03 Nov 2009, PHP 5.3.1 RC3 - Added "max_file_uploads" INI directive, which can be set to limit the diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 187b9bec30..9b384132fc 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -46,7 +46,11 @@ static void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC) if (MyG(error_msg)) { efree(MyG(error_msg)); } - MyG(error_msg) = estrdup(mysql_err); + if(mysql_err && *mysql_err) { + MyG(error_msg) = estrdup(mysql_err); + } else { + MyG(error_msg) = NULL; + } } /* }}} */ |