PHP_HTTP_INFO(info).response.code = 0;
}
if (EXPECTED(status && end > status)) {
- while (' ' == *status) ++status;
+ while (' ' == *status && end > status) ++status;
PHP_HTTP_INFO(info).response.status = estrndup(status, end - status);
} else {
PHP_HTTP_INFO(info).response.status = NULL;
PHP_HTTP_INFO(info).request.method = estrndup(pre_header, url_len);
- while (' ' == *url) ++url;
+ while (' ' == *url && http > url) ++url;
while (' ' == *(http-1)) --http;
if (EXPECTED(http > url)) {