mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
check emalloc() result
This commit is contained in:
parent
e00d48490b
commit
bce562b75e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user