From owner-svn-src-all@FreeBSD.ORG Mon May 5 23:08:37 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 11A15133 for ; Mon, 5 May 2014 23:08:37 +0000 (UTC) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85F73F6A for ; Mon, 5 May 2014 23:08:35 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id q8so3369783lbi.27 for ; Mon, 05 May 2014 16:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=0R6EA6/kME4R+NcEytuwuEg3deeTnZVqamCv+Z+2qHQ=; b=J+w1lT3udFRWD5sEDuLfXXqHmvDbAuWpM9jB4Rv44F9/LTG/JkJ1+YgEpdZrem6oDl Vw1cqcFyO54WGIUkWbHhBSaS+IZlVAYTpzwMSqBIywzXITi5C1SjFFjqbkByOWZQD6k6 80GTpE5VSZsQzsppjwlDeKOkOGWK0c6nzXQwguCv+EVCErB+pJc2vgyff+pO3xxXTuuV OALaeT1nbF2UJiVU7OJplnzBKQeMDubKeCjEgGw5xdM1Fv+0NM7aPRuV8WmCtCHsWA+r 3hnCC7TGDiP9maHVuL0sV2V2CkMOqyga2pHcU+EQii2zVB5CmSHKAlP2KiPJwtcxqq4p UcbQ== X-Gm-Message-State: ALoCoQnLZMewJllsX5922o456zKgB6n0YzYj1L/wDcveRMHhStn0vux74m8v8iqU0B1iKcfYquWW X-Received: by 10.112.168.170 with SMTP id zx10mr3959861lbb.35.1399331313652; Mon, 05 May 2014 16:08:33 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id z10sm11100823lbu.1.2014.05.05.16.08.32 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 16:08:33 -0700 (PDT) Message-ID: <536819F0.1090507@freebsd.org> Date: Tue, 06 May 2014 03:08:32 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> <5368162A.9000002@freebsd.org> In-Reply-To: <5368162A.9000002@freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers , Warner Losh 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 23:08:37 -0000 On 06.05.2014 2:52, Andrey Chernov wrote: > As I mention initially, literal enough checks is what we need to make > logic clear. In the case we discuss realloc() can be changed by > reallocf() which does n*size and NULL checks and literal "if" should be > added before malloc() to check overflow. Sorry crumpled phrase. Literal "if" for overflow checking should be added before both malloc() and reallocf(). Other ways will make the code obscure for human and hard to support. -- http://ache.vniz.net/