From: Michael Wallner Date: Tue, 17 Oct 2006 19:13:16 +0000 (+0000) Subject: - fix crash if *val == NULL X-Git-Tag: RELEASE_1_3_3~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d02141d8a062b2d7665e489ead77194f9343f09c;p=m6w6%2Fext-http - fix crash if *val == NULL --- diff --git a/http_send_api.c b/http_send_api.c index c76656c..1fe1d4d 100644 --- a/http_send_api.c +++ b/http_send_api.c @@ -200,7 +200,7 @@ PHP_HTTP_API void _http_hide_header_ex(const char *name, size_t name_len TSRMLS_ /* {{{ void http_send_header_zval(char*, zval **, zend_bool) */ PHP_HTTP_API void _http_send_header_zval_ex(const char *name, size_t name_len, zval **val, zend_bool replace TSRMLS_DC) { - if (!val || Z_TYPE_PP(val) == IS_NULL || (Z_TYPE_PP(val) == IS_STRING && !Z_STRLEN_PP(val))) { + if (!val || !*val || Z_TYPE_PP(val) == IS_NULL || (Z_TYPE_PP(val) == IS_STRING && !Z_STRLEN_PP(val))) { http_hide_header_ex(name, name_len); } else if (Z_TYPE_PP(val) == IS_ARRAY || Z_TYPE_PP(val) == IS_OBJECT) { zend_bool first = replace;