add proxy_ssl request options
[m6w6/ext-http] / src / php_http_info.c
index 5125a94f2318917369f1d7699dba5ac0f59618e4..48da6bfe2170452f4aa3adb5d2a20d35dabc6ed4 100644 (file)
@@ -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)) {