com php-src: check emalloc() result: ext/standard/http_fopen _wrapper.c
| From: | Anatol Belski | Date: | Sat, 13 Sep 2014 21:21:47 +0000 |
| Subject: | com php-src: check emalloc() result: ext/standard/http_fopen _wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81555@lists.php.net to get a copy of this message | ||
Commit: bce562b75efcdacc762a3b94915cdf02056b22dc
Author: Anatol Belski <ab@php.net> Sat, 13 Sep 2014 20:20:17 +0200
Parents: e00d48490bbba38a2757b28dfd930dbdf4870331
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bce562b75efcdacc762a3b94915cdf02056b22dc
Log:
check emalloc() result
Changed paths:
M ext/standard/http_fopen_wrapper.c
Diff:
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 45fa637..d7b62e1 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -587,6 +587,9 @@ finish:
/* ensure the header is only sent if user_agent is not blank */
if (ua_len > sizeof(_UA_HEADER)) {
ua = emalloc(ua_len + 1);
+ if (NULL == ua) {
+ return NULL;
+ }
if ((ua_len = slprintf(ua, ua_len, _UA_HEADER, ua_str)) > 0) {
ua[ua_len] = 0;
php_stream_write(stream, ua, ua_len);