Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24888 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92257 invoked by uid 1010); 22 Jul 2006 21:54:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92242 invoked from network); 22 Jul 2006 21:54:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2006 21:54:22 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; domainkeys=good DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 64.233.166.182 py-out-1112.google.com Linux 2.4/2.6 Received: from ([64.233.166.182:60508] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 3B/5B-04178-B8E92C44 for ; Sat, 22 Jul 2006 17:54:20 -0400 Received: by py-out-1112.google.com with SMTP id x31so622961pye for ; Sat, 22 Jul 2006 14:54:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Y3qqKhP8Cd0qbc/3Mk/8lpovzH2skqblJYA7snWqThe80FUQfnGMOIRqrE3F+hl5sLWSBQAP/N1oROFHKT1HOGnhrEHxWps1hRd7wqCyGM429YIblqw6AQUVtRXLfmXgajXD2dTBEaIqthQdPUEMIi0tR5jsonsIShqLFkR5dPA= Received: by 10.35.18.18 with SMTP id v18mr4118985pyi; Sat, 22 Jul 2006 14:54:17 -0700 (PDT) Received: by 10.35.93.18 with HTTP; Sat, 22 Jul 2006 14:54:17 -0700 (PDT) Message-ID: <10845a340607221454h1c8923bcg9ca534b21853bd86@mail.gmail.com> Date: Sat, 22 Jul 2006 22:54:17 +0100 Reply-To: RQuadling@GoogleMail.com To: "Matt W" Cc: internals@lists.php.net, "Andrei Zmievski" In-Reply-To: <10845a340607221404u4f515bb9w914d4a61f9345f28@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <014e01c6acbe$680b1bc0$0201a8c0@pc1> <10845a340607210543lfe173abq2221a1c833c5d9e1@mail.gmail.com> <017701c6acc6$3a526be0$0201a8c0@pc1> <00d401c6ad61$9d235810$0201a8c0@pc1> <10845a340607221404u4f515bb9w914d4a61f9345f28@mail.gmail.com> Subject: Re: [PHP-DEV] [PATCH] array_combine is not binary-key safe From: rquadling@googlemail.com ("Richard Quadling") Hi. Sorry about the delay. Had a blonde moment. I've used a small script to process the CVS. There are 420 changes!!! I've used the following regexps for a search/replace ... $s_search = '`add_assoc_(bool|double|long|null|resource|rt_stringl|rt_string|stringl|string|unicodel|unicode|zval)*\(([^,]*), "(.*?)",`i'; $s_replace = 'add_assoc_$1_ex($2, "$3", sizeof("$3")+1,'; Everything SEEMS to look ok. Until I've got MS VC Express Edition compiling ok, this patch is UNTESTED!! (Sorry about that). Files changed. php-src/ext/bz2/bz2.c php-src/ext/calendar/calendar.c php-src/ext/curl/multi.c php-src/ext/curl/streams.c php-src/ext/date/php_date.c php-src/ext/dbase/dbase.c php-src/ext/exif/exif.c php-src/ext/fbsql/php_fbsql.c php-src/ext/fdf/fdf.c php-src/ext/gd/gd.c php-src/ext/gmp/gmp.c php-src/ext/hwapi/hwapi.cpp php-src/ext/iconv/iconv.c php-src/ext/interbase/ibase_blobs.c php-src/ext/interbase/ibase_query.c php-src/ext/interbase/ibase_service.c php-src/ext/ldap/ldap.c php-src/ext/mbstring/mbstring.c php-src/ext/oci8/oci8_interface.c php-src/ext/openssl/openssl.c php-src/ext/pdo/pdo_stmt.c php-src/ext/pdo_mysql/mysql_statement.c php-src/ext/pdo_pgsql/pgsql_statement.c php-src/ext/pdo_sqlite/sqlite_statement.c php-src/ext/pgsql/pgsql.c php-src/ext/posix/posix.c php-src/ext/session/session.c php-src/ext/soap/php_http.c php-src/ext/sockets/sockets.c php-src/ext/standard/basic_functions.c php-src/ext/standard/datetime.c php-src/ext/standard/dns.c php-src/ext/standard/file.c php-src/ext/standard/html.c php-src/ext/standard/image.c php-src/ext/standard/microtime.c php-src/ext/standard/proc_open.c php-src/ext/standard/streamsfuncs.c php-src/ext/standard/string.c php-src/ext/standard/url.c php-src/ext/sysvmsg/sysvmsg.c php-src/main/output.c php-src/main/streams/filter.c php-src/main/streams/memory.c php-src/main/streams/xp_socket.c Patch is available at http://rquadling.phpnet.us/add_assoc_xxx__to__add_assoc_xxx_ex__diff.txt Regards, Richard Quadling. > On 22/07/06, Matt W wrote: > > Hi Andrei, > > > > I see you applied my patch. However, the 5.2 code still isn't binary-key > > safe (you only changed the second occurrence of add_assoc_zval to the _ex > > version). Or was that intentional and you only want to change the behavior > > in 6? > > > > And you know 5.2's description is still wrong -- with "keys" at the end > > instead of "values"? :-) When you changed that part in HEAD last week, you > > also added a "the" -- "... as _the_ corresponding _values_" -- which was in > > my patch, if you want both branches *exactly* the same. :-P > > > > > > Matt > > > > P.S. The other patch you're talking about below... I think Richard Quadling > > said he'll do it. > > > > > > ----- Original Message ----- > > From: "Andrei Zmievski" > > Sent: Friday, July 21, 2006 > > > > > > > Yeah, that's probably a good idea. You can submit a patch if you > > > want. :) > > > > > > -Andrei > > > > > > > > > On Jul 21, 2006, at 6:04 AM, Matt W wrote: > > > > > > > Hi Richard, > > > > > > > > I think I've seen those instances that you're referring to. By > > > > fixed length > > > > string I assume you mean hard-coded "string_key". Yeah, I would > > > > think those > > > > should use add_assoc_*_ex() since the length is known (sizeof > > > > ("string_key") > > > > etc.) to save unnecessary strlen() calls. > > > > > > > > Unless compilers optimize the strlen("string_key") + 1 to a > > > > constant from > > > > the add_assoc_*() macro. But I wouldn't think that's the case...? :-/ > > > > > > > > > > > > Matt > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"