Skip to content

Commit d9b2c9f

Browse files
committed
fix: null-terminated zend_string in s_decompress_value
1 parent 6ee96ca commit d9b2c9f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)