We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3a0e49 commit cb6dea6Copy full SHA for cb6dea6
sapi/cgi/cgi_main.c
@@ -1661,13 +1661,15 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
1661
static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */
1662
{
1663
char *s, *p;
1664
- int len;
+ int len = 0;
1665
ALLOCA_FLAG(use_heap)
1666
1667
if (h->header_len > 0) {
1668
p = strchr(h->header, ':');
1669
- len = p - h->header;
1670
- if (p && (len > 0)) {
+ if (NULL != p) {
+ len = p - h->header;
1671
+ }
1672
+ if (len > 0) {
1673
while (len > 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t')) {
1674
len--;
1675
}
0 commit comments