Skip to content

Commit 304806f

Browse files
author
Mikko Koppanen
committed
Merge pull request php-memcached-dev#120 from vincentbernat/fix/compression-bigendian
Fix compression on big-endian architecture
2 parents 03d2244 + 98e7e6b commit 304806f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

php_memcached.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3084,9 +3084,10 @@ char *s_compress_value (enum memcached_compression_type compression_type, const
30843084

30853085
/* Store compressed size here */
30863086
size_t compressed_size = 0;
3087+
uint32_t plen = *payload_len;
30873088

30883089
/* Copy the uin32_t at the beginning */
3089-
memcpy(buffer, payload_len, sizeof(uint32_t));
3090+
memcpy(buffer, &plen, sizeof(uint32_t));
30903091
buffer += sizeof(uint32_t);
30913092

30923093
switch (compression_type) {

0 commit comments

Comments
 (0)