X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_headers_api.c;h=09673e99a884d9f6c23a5a4dda075ca704535f21;hp=cc4e60974e3f7b0c3ff5760569ba4b78077a5e85;hb=9d0eaae0af2de89a57be321c507e5a9956ba99f9;hpb=96b6d481cfa03fae8c40a6ab7c2156036b082d7d diff --git a/http_headers_api.c b/http_headers_api.c index cc4e609..09673e9 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -111,7 +111,7 @@ PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_ range = Z_STRVAL_P(zrange); if (strncmp(range, "bytes=", sizeof("bytes=") - 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Range header misses bytes="); + http_error(E_NOTICE, HTTP_E_HEADER, "Range header misses bytes="); return RANGE_NO; } @@ -248,7 +248,8 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(char *header, size_t header_len, Z_ARRVAL(array) = headers; - if (header_len < 2) { + if (header_len < 2 || !strchr(header, ':')) { + http_error(E_WARNING, HTTP_E_PARSE, "Cannot parse too short or malformed HTTP headers"); return FAILURE; }