|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-13 13:04 UTC] ab@php.net
[2012-08-13 13:11 UTC] ab@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: ab
[2012-08-13 13:11 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 23:00:01 2025 UTC |
Description: ------------ Inside 'main_apc.c' in the method called 'static int apc_load_data(const char *data_file TSRMLS_DC)', the length of the key of the value that needs to be stored is determined with the following line : key_len = strlen(key); If I am correct this is only the length of the string itself without the null-terminator However, "_apc_store" seems to want the length of the key string including the terminator. If I change the line above to : key_len = strlen(key)+1; then it works as expected. You can also notice that 1 character is missing when looking at the user cache entries apc.php. But if you try to use that as a key then APC will not return the contents so that didn't work as a workaround. Test script: --------------- 1. Create a small textfile called 'abc.data' with the following string: s:2:"123" Make sure it has a null terminator at the end of the string. 2. set the apc.preload_path= setting to a certain path. 3. move the text file to that directory 4. reload Apache 5. run apc.php and check the user entries. 6. note that the name of the entry will be 'ab' and that nor 'ab' or 'abc' will return the contents. Expected result: ---------------- a serialized file with the filename 'abc.data' will be loaded into the apc user entries and with the key 'abc' one can retrieve the data. Actual result: -------------- a serialized file with the filename 'abc.data' will be loaded but the name of the key will be 'ab' and it's contents cannot be retrieved