Skip to content

Commit 0986493

Browse files
committed
Merge pull request #252 from dictcp/fix-null-string-decompress
fix #250: non-null-terminated zend_string in s_decompress_value
2 parents 6ee96ca + d9b2c9f commit 0986493

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

php_memcached.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,6 +3443,8 @@ zend_string *s_decompress_value (const char *payload, size_t payload_len, uint32
34433443
decompress_status = (uncompress((Bytef *) buffer->val, &buffer->len, (Bytef *)payload, payload_len) == Z_OK);
34443444
}
34453445

3446+
ZSTR_VAL(buffer)[stored_length] = '\0';
3447+
34463448
if (!decompress_status) {
34473449
php_error_docref(NULL, E_WARNING, "could not decompress value");
34483450
zend_string_release (buffer);

0 commit comments

Comments
 (0)