Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57662 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50447 invoked from network); 3 Feb 2012 14:16:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2012 14:16:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:56463] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/04-11798-54CEB2F4 for ; Fri, 03 Feb 2012 09:16:37 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 1A37870004A8; Fri, 3 Feb 2012 14:16:34 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id TBpsN086lJfu; Fri, 3 Feb 2012 14:16:33 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id DC33770004A3; Fri, 3 Feb 2012 14:16:33 +0000 (WET) Received: from slws007.slhq.int (a79-168-248-114.cpe.netcabo.pt [79.168.248.114]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id C61A52025890; Fri, 3 Feb 2012 14:16:32 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "John LeSueur" Cc: internals@lists.php.net References: Date: Fri, 03 Feb 2012 15:16:31 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.61 (Win32) Subject: Re: [PHP-DEV] The case of HTTP response splitting protection in PHP From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Fri, 03 Feb 2012 15:13:56 +0100, John LeSueur wrote: > I could be wrong, but doesn't: > (header_line[i+1] != ' ' && header_line[i+1] != '\t') > access an element past the end of the header_line array on the last > iteration of the for loop? shouldn't the for loop go until > header_line_len > - 1? > No in this case because header_line_len is the length not including the terminator and estrndup guarantees a null terminated string. Thanks -- Gustavo Lopes