From 9a02b1a9ef8dc62a241148405be8058e0df4250e Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 9 Apr 2018 12:33:01 +0200 Subject: [PATCH] prepare release v3.2.0RC1 * PHP-7.2 compatibility * Fixed gh-issue #73: build fails with libidn and libidn2 + Added brotli compression support + Implemented gh-issue #58: Notify observers before any request is built --- package.xml | 15 +++++++++------ src/php_http_buffer.c | 12 ++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.xml b/package.xml index d811172..62c1a58 100644 --- a/package.xml +++ b/package.xml @@ -31,18 +31,21 @@ https://mdref.m6w6.name/http mike@php.net yes - 2017-04-04 + 2018-04-09 - 3.1.1dev - 3.1.0 + 3.2.0RC1 + 3.2.0 - stable - stable + beta + beta BSD-2-Clause diff --git a/src/php_http_buffer.c b/src/php_http_buffer.c index 9ff4065..c865065 100644 --- a/src/php_http_buffer.c +++ b/src/php_http_buffer.c @@ -117,9 +117,11 @@ PHP_HTTP_BUFFER_API size_t php_http_buffer_append(php_http_buffer_t *buf, ) { return PHP_HTTP_BUFFER_NOMEM; } - memcpy(buf->data + buf->used, append, append_len); - buf->used += append_len; - buf->free -= append_len; + if (append_len) { + memcpy(buf->data + buf->used, append, append_len); + buf->used += append_len; + buf->free -= append_len; + } return append_len; } @@ -147,7 +149,9 @@ PHP_HTTP_BUFFER_API char *php_http_buffer_data(const php_http_buffer_t *buf, char **into, size_t *len) { char *copy = ecalloc(1, buf->used + 1); - memcpy(copy, buf->data, buf->used); + if (buf->data) { + memcpy(copy, buf->data, buf->used); + } if (into) { *into = copy; } -- 2.30.2