Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21733 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38844 invoked by uid 1010); 30 Jan 2006 09:08:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38829 invoked from network); 30 Jan 2006 09:08:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2006 09:08:36 -0000 X-Host-Fingerprint: 81.169.145.179 natipslore.rzone.de Solaris 10 (beta) Received: from ([81.169.145.179:57556] helo=natipslore.rzone.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B6/E9-37522-397DDD34 for ; Mon, 30 Jan 2006 04:08:36 -0500 Received: from [192.168.1.77] (p50876131.dip.t-dialin.net [80.135.97.49]) by post.webmailer.de (8.13.1/8.13.1) with ESMTP id k0U98V9q002350; Mon, 30 Jan 2006 10:08:32 +0100 (MET) Message-ID: <43DDD78E.7080403@php.net> Date: Mon, 30 Jan 2006 10:08:30 +0100 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sara Golemon CC: internals@lists.php.net References: <43DD2D20.5010001@php.net> <000c01c62534$d48aef80$7d051fac@stumpy> In-Reply-To: <000c01c62534$d48aef80$7d051fac@stumpy> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: zend_hash.c fishy code From: sesser@php.net (Stefan Esser) Hello Sara, you are missing my point. My point is that when a hashtable contains these two elements example: BUCKET_ENTRY for h=15 --- Bucket1 : key == numeric -> h= numeric hash value == 15 \-------- Bucket2: key == some string key, with a hash value equal to 15 Lets assume we want to delete the key "THI_HASH_A_HASH_FUNCTION_VALUE_OF_15" then the code in question will first hash it and gets h==15. The next thing it will do is go through the linked list of buckets for h==15. Unfortunately the check there is broken. It will first check, that p->h is == 15 and then check if p->nKeyLength==0 which obviously is for our Bucket1. Unfortunately this is already enough to evaluate to true. But it is not what we intended. We wanted to delete bucket2. But we end up with Bucket1 deleted. Stefan