Skip to content

Commit a3cb69d

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: add protection against nulls
2 parents e2744c5 + ef4896d commit a3cb69d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/spprintf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ PHPAPI int vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap
813813
{
814814
smart_str xbuf = {0};
815815

816+
/* since there are places where (v)spprintf called without checking for null,
817+
a bit of defensive coding here */
818+
if(!pbuf) {
819+
return 0;
820+
}
816821
xbuf_format_converter(&xbuf, format, ap);
817822

818823
if (max_len && xbuf.len > max_len) {

0 commit comments

Comments
 (0)