X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_api.c;h=06ac89a176d271e16ac74e11cf8b6eadec9a0661;hb=b8c0e6a24fd1c900d9881ea899149cde16320140;hp=4fa8c3d5b703203f92b84c083e421500bc7f8a9b;hpb=8331a664f8eb649250252eb99885a99773cdd700;p=m6w6%2Fext-http diff --git a/http_api.c b/http_api.c index 4fa8c3d..06ac89a 100644 --- a/http_api.c +++ b/http_api.c @@ -357,6 +357,9 @@ PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_ memcpy(*body + *length, buf, len); *length += len; (*body)[*length] = '\0'; + if (len < sizeof(buf)) { + break; + } } /* check for error */ @@ -395,6 +398,9 @@ PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D) while (0 < (len = sapi_module.read_post(buf, sizeof(buf) TSRMLS_CC))) { php_stream_write(s, buf, len); + if (len < sizeof(buf)) { + break; + } } if (len < 0) {