Permalink
Browse files

Fix compression of serialized objects.

Due to commit 0f5550e, compressing a
serialized object provided an inappropriate size to `s_compress_value()`
which will eventually lead to a segfault during compression. Provide the
the previously computed length instead.
  • Loading branch information...
1 parent 3d324df commit f794ebed54048e5dd6d858469a4b06e4722d331a @vincentbernat vincentbernat committed Jan 8, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 php_memcached.c
View
@@ -3266,7 +3266,7 @@ char *php_memc_zval_to_payload(zval *value, size_t *payload_len, uint32_t *flags
/* If we have compression flag, compress the value */
if (MEMC_VAL_HAS_FLAG(*flags, MEMC_VAL_COMPRESSED)) {
/* status */
- *payload_len = Z_STRLEN_P(value);
+ *payload_len = pl_len;
payload = s_compress_value (compression_type, pl, payload_len, flags TSRMLS_CC);
}

0 comments on commit f794ebe

Please sign in to comment.