cvs: pecl /apc php_apc.c
| From: | Gopal Vijayaraghavan | Date: | Wed, 18 Feb 2009 09:54:32 +0000 |
| Subject: | cvs: pecl /apc php_apc.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-11977@lists.php.net to get a copy of this message | ||
gopalv Wed Feb 18 09:54:32 2009 UTC
Modified files:
/pecl/apc php_apc.c
Log:
Fix off-by one error in multi-key apc_store()
http://cvs.php.net/viewvc.cgi/pecl/apc/php_apc.c?r1=3.209&r2=3.210&diff_format=u
Index: pecl/apc/php_apc.c
diff -u pecl/apc/php_apc.c:3.209 pecl/apc/php_apc.c:3.210
--- pecl/apc/php_apc.c:3.209 Wed Feb 18 08:59:00 2009
+++ pecl/apc/php_apc.c Wed Feb 18 09:54:31 2009
@@ -26,7 +26,7 @@
*/
-/* $Id: php_apc.c,v 3.209 2009/02/18 08:59:00 gopalv Exp $ */
+/* $Id: php_apc.c,v 3.210 2009/02/18 09:54:31 gopalv Exp $ */
#include "apc_zend.h"
#include "apc_cache.h"
@@ -223,7 +223,7 @@
php_info_print_table_row(2, "MMAP Support", "Disabled");
#endif
php_info_print_table_row(2, "Locking type", APC_LOCK_TYPE);
- php_info_print_table_row(2, "Revision", "$Revision: 3.209 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 3.210 $");
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -651,7 +651,8 @@
while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) {
zend_hash_get_current_key_ex(hash, &hkey, &hkey_len, &hkey_idx, 0,
&hpos);
if (hkey) {
- if(!_apc_store(hkey, hkey_len, *hentry, (unsigned int)ttl, exclusive TSRMLS_CC)) {
+ /* hkey_len - 1 for consistency, because it includes '\0', while
Z_STRLEN_P() doesn't */
+ if(!_apc_store(hkey, hkey_len - 1, *hentry, (unsigned int)ttl, exclusive
TSRMLS_CC)) {
add_assoc_long_ex(return_value, hkey, hkey_len, -1); /* -1: insertion error */
}
hkey = NULL;