Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56278 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87109 invoked from network); 11 Nov 2011 14:45:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2011 14:45:35 -0000 Authentication-Results: pb1.pair.com header.from=arraypad@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arraypad@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: arraypad@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:37456] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/B0-17932-E053DBE4 for ; Fri, 11 Nov 2011 09:45:34 -0500 Received: by vwl1 with SMTP id 1so3838283vwl.29 for ; Fri, 11 Nov 2011 06:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yPKKvo3MLz0oFoA5b2GPx8+jMFgOWV/jMPfnTlrQuqM=; b=fmiBGPd79KuX9TKzR7qEiFUYbgBiZeYRamCQbcTcshgO7Jj7JkEOSDoLW3y3ccE53a i67A1DgrnMxoUS6TAFo7rc4JgQ3QayS4MyGuNYNgYDgxoCXb12DzgezD3EGl21dRwv6B qUuYV01eIOIKDe6TGlGCuIm1ybZ6Cj6/Q2pMQ= MIME-Version: 1.0 Received: by 10.52.33.51 with SMTP id o19mr10985134vdi.119.1321022732210; Fri, 11 Nov 2011 06:45:32 -0800 (PST) Received: by 10.52.182.130 with HTTP; Fri, 11 Nov 2011 06:45:32 -0800 (PST) In-Reply-To: <4EBC6986.3090709@lerdorf.com> References: <4EBC6986.3090709@lerdorf.com> Date: Fri, 11 Nov 2011 14:45:32 +0000 Message-ID: To: Rasmus Lerdorf Cc: PHP internals Content-Type: multipart/alternative; boundary=20cf307cffb8b192f304b176924c Subject: Re: Hash problems in session-oo code From: arraypad@gmail.com (Arpad Ray) --20cf307cffb8b192f304b176924c Content-Type: text/plain; charset=ISO-8859-1 On Fri, Nov 11, 2011 at 12:17 AM, Rasmus Lerdorf wrote: > Hey Arpad, looking through the code you added to > ext/standard/basic_functions.c it looks like you are doing some weird > key handling in the shutdown function hash. > > Hi Rasmus, Thanks for the heads up, just fixed these. Cheers, Arpad > In register_user_shutdown_function() you have: > > zend_hash_update(BG(user_shutdown_function_names), function_name, > sizeof(function_name), shutdown_function_entry, > sizeof(php_shutdown_function_entry), NULL) > > And in remove_user_shutdown_function() you have: > > zend_hash_del_key_or_index(BG(user_shutdown_function_names), > function_name, sizeof(function_name), 0, HASH_DEL_KEY) > > In both cases function_name is a char* so sizeof(function_name) is > always going to be the size of a char* on whatever architecture you are > on. But the way hash keys work, it is the actual string that is the key > and you should be passing the length of that string here. > > -Rasmus > --20cf307cffb8b192f304b176924c--