X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_info.c;h=48da6bfe2170452f4aa3adb5d2a20d35dabc6ed4;hp=5125a94f2318917369f1d7699dba5ac0f59618e4;hb=567a61130ed7f4fd7b47fe104ec32990f84bc06e;hpb=13662c61792685435496cd25c95ee1c1950cd9d7 diff --git a/src/php_http_info.c b/src/php_http_info.c index 5125a94..48da6bf 100644 --- a/src/php_http_info.c +++ b/src/php_http_info.c @@ -163,7 +163,7 @@ php_http_info_t *php_http_info_parse(php_http_info_t *info, const char *pre_head 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; @@ -182,7 +182,7 @@ php_http_info_t *php_http_info_parse(php_http_info_t *info, const char *pre_head 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)) {