From owner-svn-src-all@FreeBSD.ORG Mon May 5 19:56:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AD42B4C for ; Mon, 5 May 2014 19:56:18 +0000 (UTC) Received: from nm36-vm2.bullet.mail.bf1.yahoo.com (nm36-vm2.bullet.mail.bf1.yahoo.com [72.30.238.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94BBBC9 for ; Mon, 5 May 2014 19:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1399319380; bh=3hFInMOsQKBCZ1n8PXKK5qdB8LOpGH+g65TLBNm9auA=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=XvrR+Tz5SnHMvwXLVmmEMP983/IX2Pdn4M8S6bGz3fc7f2iLZj1IgqjDcsEgfm7QoaZlpudruhkEcZwG+euta8qB7Tzl0+Om+OTUWPX25XzrGSoE3p4BoDT6Mi3KiNmLr8h0SyxUmP6V1vMBD87F24L2bMZrZ7QMIFDPs6ye8FpqJks0DfN+j2VTOGvQBjcc+DxZMcB6zrBH8AzmJfn1MZQj0wGY8SR8I4nqW4VlsUPvuiRnNydf4xaJRAqnxHWg7DYYKsYkvsawOh7TiWMtEsXob8hCyBK2H4YiLo3gGL3ayvf7iqOveJ1N/kb1OaLBTMFjTUt6oxwpNvRKKD16OA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=bFD71vSD+yn2P1Ipy53JKmwy6wuQYOsTAPrnNFhX6rUe/49u+v4RkHHZM4eiyWPm7opeG+NjCfjTzt3AlNSant8ycFpkCq3KjAXP0li5LeLu6WIutHAhjxcFoya5OTR58ht741eQzArUu7SudtDEHEO1C1vwxR0SxwZd3JtwIsy6nRqT4So+1Y3FsWnhOOH4wr6dpEyeVlgd6DLj6BRxzTIdeWMeRp4AU2r3BXBeoBvU66dxKjiyu8B5ujcu4sCm5WuCc8USGf2fEJYSKEhy2TOj8KzDF6rmv0S0KZrTF83sJA+AFB5hTixyYbuisfyjrBzbQtn0mP0eq2oppI/5qw==; Received: from [98.139.215.141] by nm36.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2014 19:49:40 -0000 Received: from [98.139.211.163] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2014 19:49:40 -0000 Received: from [127.0.0.1] by smtp220.mail.bf1.yahoo.com with NNFMP; 05 May 2014 19:49:40 -0000 X-Yahoo-Newman-Id: 130731.35938.bm@smtp220.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: LSipnMYVM1m0n4KsDKsSMTDDkZ7s_1Lbnq8uZsq6DT2isMK gNgBTdP4PiBYE6KSNY_3KKe9HEk6Ys7CQg8505daBN.bPMGanOuptEgM7Wxq 3BfK4ct_ndywrSfhVan5nFNWgUPkPC91Rg17jyGfaRw4pXrUSo31rNIZfmhF ZaP7YKFFynokNpaI4m49kHWrbJXwYzpvdKYpWl27oMUN3B2FRi72P8nrW0av h28CUbA8G4SDe_rtQv4V9ylRQN_rglV3gbK3FPbJPLr9ggwsHU3iV.z9wmXL zDdSg1T2vykLCoy6sexGsoR5TFujIVcAUa5kXYG7l8KvHs9MR6P13UYKTyx1 sTiTws2ilM3JtsV3T.2PnC4xods1gI5lhIFgaxhd4C_2eJLse.lrHqkzKcEg SSKtX4deTPt9e9qfBTRGVUygixnOTs5HnAxcPhi8oLKPvPRAHaP9g1P.UAcK TquqxhsIKWjjYMBqjKaaCadAuAkdH3EQskLn1SX0t7lXmH02HLrocTMQ5aun oDRdc7u1bXEw4k9G69_sEAjIuLg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp220.mail.bf1.yahoo.com with SMTP; 05 May 2014 19:49:40 +0000 UTC Message-ID: <5367EB54.1080109@FreeBSD.org> Date: Mon, 05 May 2014 14:49:40 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall , Andrey Chernov Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 19:56:18 -0000 El 5/5/2014 1:28 PM, David Chisnall escribió: > On 5 May 2014, at 18:42, Andrey Chernov wrote: > >> Please don't commit OpenBSD errors. Now you mix calloc() with the >> realloc() for the same variable later which makes calloc() zeroing >> pointless and waste of CPU. > > The purpose of calloc() here is not (primarily) to get the zero'd size, it's to get the overflow-checking behaviour for calloc. > Yes, but I reverted it because there are other ways to check for overflows without the performance hit. > The uses of realloc() later do still potentially overflow, as they follow the realloc(pointer, size * sizeof(type)) antipattern. > FWIW, I actually got to this by checking kern/169302: unfortunately it is unclear if the NetBSD patch there (with or without the OpenBSD change) helps with the test case. Pedro.