Closed mszabo-wikia closed 1 year ago
What version of the extension are you using? The line numbers are off by about 50 lines from current master
Hey, thank you for the follow-up - this is with version 3.2.0 from PECL on PHP 8.0.25.
@mszabo-wikia can you test if this minor change is enough ?
diff --git a/php_memcached.c b/php_memcached.c
index 7ccc9b5..ece5440 100644
--- a/php_memcached.c
+++ b/php_memcached.c
@@ -86,7 +86,7 @@ static int php_memc_list_entry(void) {
/****************************************
Payload value flags
****************************************/
-#define MEMC_CREATE_MASK(start, n_bits) (((1 << n_bits) - 1) << start)
+#define MEMC_CREATE_MASK(start, n_bits) (((1U << n_bits) - 1) << start)
#define MEMC_MASK_TYPE MEMC_CREATE_MASK(0, 4)
#define MEMC_MASK_INTERNAL MEMC_CREATE_MASK(4, 12)
ALso see pr #526 (you can try issue-522 branch)
Thank you, I will try out the updated branch & let you know!
The fixed branch seems to resolve the issue—I haven't yet had time to test to ensure it does not actually change the value of the flags, but this is promising!
While investigating an unrelated issue on a build of PHP + extensions compiled with sanitizers, I stumbled across the following UBSAN error, an apparent signed integer overflow:
I would assume this does not actually break anything as existing code has likely come to rely on the undefined behavior. I looked into what it would take to run tests with ASAN enabled, but so far it seems it may require a PHP binary itself compiled with ASAN, which is not ideal.