Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15604 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3433 invoked by uid 1010); 25 Mar 2005 15:08:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3413 invoked from network); 25 Mar 2005 15:08:18 -0000 Received: from unknown (HELO thieso.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2005 15:08:18 -0000 X-Host-Fingerprint: 151.189.21.48 mail-in-08.arcor-online.net Linux 2.5 (sometimes 2.4) (4) Received: from ([151.189.21.48:47295] helo=mail-in-08.arcor-online.net) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id B0/4F-61605-16924424 for ; Fri, 25 Mar 2005 10:08:18 -0500 Received: from tc.ma.cx (dsl-084-059-201-234.arcor-ip.net [84.59.201.234]) by mail-in-08.arcor-online.net (Postfix) with ESMTP id EC54C4418D; Fri, 25 Mar 2005 16:08:08 +0100 (CET) Received: from localhost (schnuffel [127.0.0.1]) by tc.ma.cx (Postfix) with ESMTP id A933162DB1; Fri, 25 Mar 2005 16:08:08 +0100 (CET) Received: from tc.ma.cx ([127.0.0.1]) by localhost (schnuffel.thieso.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10568-05; Fri, 25 Mar 2005 16:08:07 +0100 (CET) Received: from [192.168.255.7] (mini.thieso.net [192.168.255.7]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by tc.ma.cx (Postfix) with ESMTP id DEA8662DB0; Fri, 25 Mar 2005 16:08:07 +0100 (CET) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: Thies C.Arntzen , internals@lists.php.net Date: Fri, 25 Mar 2005 16:08:07 +0100 To: Derrell.Lipman@UnwiredUniverse.com X-Mailer: Apple Mail (2.619.2) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at thieso.net Subject: Re: [PHP-DEV] pdo: patch to make leading colon unneeded for bound variables without breaking BC. From: thies@thieso.net (Thies C . Arntzen) Am 25.03.2005 um 15:28 schrieb Derrell.Lipman@UnwiredUniverse.com: > "Thies C. Arntzen" writes: > >> diff -u -w -r1.95 pdo_stmt.c >> --- ext/pdo/pdo_stmt.c 24 Mar 2005 12:32:06 -0000 1.95 >> +++ ext/pdo/pdo_stmt.c 25 Mar 2005 13:13:18 -0000 >> @@ -242,6 +242,13 @@ >> >> hash = is_param ? stmt->bound_params : stmt->bound_columns; >> >> + if (param->name) { >> + if (param->name[0] == ':') { >> + param->name = param->name + 1; > > Sanity check... > > Without researching thoroughly, this "appears" to warrant further > inspection. > The field param->name is clearly a pointer since you're able to > increment it. > It seems likely, then, that param->name was dynamically allocated. If > that's > not the case, then you can stop reading. If it is, though, then by > incrementing param->name, what happens when param->name is freed? I > didn't > see any place in the patch where it is marked as having been > incremented nor > anyplace where it is decremented in order to be freed. > > acutally i did a bit of checking... really_register_bound_param is called from two places... and at the end it does: if (param->name) { param->name = estrndup(param->name, param->namelen); so i believe my patch is safe. i agree that it could|should be done nicer... -tc