|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-24 06:59 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: hradtke
+Assigned To:
[2020-03-13 16:46 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2020-03-13 16:46 UTC] cmb@php.net
[2020-03-22 04:22 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
Description: ------------ Memcache client isn't able to increment or decrement keys by values larger that or equal to 2^31, because it cast delta argument to 32-bit int. Reproduce code: --------------- Increment any key by 2500000000. Patch: memcache.c: 243c243 < static int mmc_incr_decr(mmc_t *, int, char *, int, int, long * TSRMLS_DC); --- > static int mmc_incr_decr(mmc_t *, int, char *, int, long, long * TSRMLS_DC); 1743c1743 < static int mmc_incr_decr(mmc_t *mmc, int cmd, char *key, int key_len, int value, long *number TSRMLS_DC) /* {{{ */ --- > static int mmc_incr_decr(mmc_t *mmc, int cmd, char *key, int key_len, long value, long *number TSRMLS_DC) /* {{{ */ 1749c1749 < command_len = spprintf(&command, 0, "incr %s %d", key, value); --- > command_len = spprintf(&command, 0, "incr %s %ld", key, value); 1752c1752 < command_len = spprintf(&command, 0, "decr %s %d", key, value); --- > command_len = spprintf(&command, 0, "decr %s %ld", key, value); Still, it will not fix it on 32-bit machines, but one could try using 'long long' and '%lld', but more changes might be required in other functions, as they seem to user 'long' values too. Actual result: -------------- CLIENT_ERROR invalid numeric delta argument