summaryrefslogtreecommitdiff
path: root/main/streams/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/streams/memory.c')
-rw-r--r--main/streams/memory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 56ffe344aa..a1af61e3f0 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -695,7 +695,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
}
/* found parameter ... the heart of cs ppl lies in +1/-1 or was it +2 this time? */
plen = sep - path;
- vlen = (semi ? semi - sep : mlen - plen) - 1 /* '=' */;
+ vlen = (semi ? (size_t)(semi - sep) : (mlen - plen)) - 1 /* '=' */;
key = estrndup(path, plen);
if (plen != sizeof("mediatype")-1 || memcmp(key, "mediatype", sizeof("mediatype")-1)) {
add_assoc_stringl_ex(&meta, key, plen, sep + 1, vlen);
@@ -720,7 +720,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
dlen--;
if (base64) {
- base64_comma = php_base64_decode((const unsigned char *)comma, dlen);
+ base64_comma = php_base64_decode_ex((const unsigned char *)comma, dlen, 1);
if (!base64_comma) {
zval_ptr_dtor(&meta);
php_stream_wrapper_log_error(wrapper, options, "rfc2397: unable to decode");
@@ -770,7 +770,8 @@ PHPAPI php_stream_wrapper_ops php_stream_rfc2397_wops = {
NULL, /* unlink */
NULL, /* rename */
NULL, /* mkdir */
- NULL /* rmdir */
+ NULL, /* rmdir */
+ NULL, /* stream_metadata */
};
PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper = {