X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_headers_api.c;h=4f255fe206a2aa656b0190d6f5b23ba06dbd6331;hp=e320f46b8ca2864e108c70d425464361ef86a7da;hb=bb1f32fd5d06b9b9ace6517c177b0fe58c9ff57c;hpb=44d0c1d32c01476ccb5edefcf4d5cdaa46b8e5e6 diff --git a/http_headers_api.c b/http_headers_api.c index e320f46..4f255fe 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -331,7 +331,10 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header size_t header_len; zval array; + INIT_PZVAL(&array); + Z_TYPE_P(array) = IS_ARRAY; Z_ARRVAL(array) = headers; + if (body) { header_len = body - header; } else { @@ -341,7 +344,7 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header while (header_len >= (size_t) (line - begin)) { int value_len = 0; - + /* note: valgrind may choke on that -- should be safe though */ switch (*line++) { case ':':