diff options
author | Anatol Belski <ab@php.net> | 2014-12-30 19:41:07 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-30 19:41:07 +0100 |
commit | a78eaddbe00d5832ccca8d48a745e1d36e67874c (patch) | |
tree | 721009abb78fe82b36b631f0953f657d37fa656f | |
parent | 2d561e0e26a511225ffafb25020c4931c6c17ae4 (diff) | |
parent | 85b4a6552029b1f3fdb39251f37986fafcb958a1 (diff) | |
download | php-git-a78eaddbe00d5832ccca8d48a745e1d36e67874c.tar.gz |
Merge branch 'PHP-5.6'
* PHP-5.6:
updated NEWS
Fixed bug #68671 incorrect expression in libmagic
Conflicts:
ext/fileinfo/libmagic/print.c
-rw-r--r-- | ext/fileinfo/libmagic/print.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/fileinfo/libmagic/print.c b/ext/fileinfo/libmagic/print.c index 7e4a812818..b028801524 100644 --- a/ext/fileinfo/libmagic/print.c +++ b/ext/fileinfo/libmagic/print.c @@ -59,15 +59,18 @@ protected void file_magwarn(struct magic_set *ms, const char *f, ...) { va_list va; - char *expanded_format; + char *expanded_format = NULL; + int expanded_len; va_start(va, f); - if (vasprintf(&expanded_format, f, va)); /* silence */ + expanded_len = vasprintf(&expanded_format, f, va); va_end(va); - php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format); + if (expanded_len >= 0 && expanded_format) { + php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format); - free(expanded_format); + free(expanded_format); + } } protected const char * |