php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch wrong_arkey_alloc_fix for APC Bug #61219

Patch version 2012-03-08 20:23 UTC

Return to Bug #61219 | Download this patch
Patch Revisions:

Developer: ab@php.net

Index: apc_compile.c
===================================================================
--- apc_compile.c	(revision 324014)
+++ apc_compile.c	(working copy)
@@ -899,8 +899,8 @@
                 newp->arKey = arKey;
             }
         } else {
-            CHECK((newp = (Bucket*) apc_pmemcpy(curr, (sizeof(Bucket) + curr->nKeyLength), pool TSRMLS_CC)));
-            newp->arKey = ((char*)newp) + sizeof(Bucket);
+            CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
+            CHECK((newp->arKey = (char*) apc_pmemcpy(curr->arKey, curr->nKeyLength, pool TSRMLS_CC)));
         }        
 #else
         CHECK((newp = (Bucket*) apc_pmemcpy(curr,
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 19:02:15 2014 UTC