Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-m.one.com (mx-m.one.com [91.198.169.60])
	by mail6.local.one.com (Postfix) with ESMTP id 07A5F30039D1DF
	for <filtered@awaresystems.be>; Wed, 31 Dec 2014 16:53:32 +0000 (UTC)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-m: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.215.43 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43])
	by mx-m.one.com (Postfix) with ESMTP id BFD7F214C3A96
	for <filtered@awaresystems.be>; Wed, 31 Dec 2014 16:53:31 +0000 (UTC)
Received: by mail-la0-f43.google.com with SMTP id s18so14065041lam.30
        for <filtered@awaresystems.be>; Wed, 31 Dec 2014 08:53:31 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-original-authentication-results:delivered-to:delivered-to:date
         :from:to:in-reply-to:message-id:references:user-agent:mime-version
         :cc:subject:precedence:list-id:list-unsubscribe:list-archive
         :list-post:list-help:list-subscribe:content-type
         :content-transfer-encoding:sender:errors-to;
        bh=MhscqiMKNVTyIpOzKtTx6bOMD9kohiwB1ORAKaGLqD0=;
        b=Lp/1Im92B8aytxKgpvAZadvmDGgt1MRvDARcj5lyotW84alvWUHqNQ6A/fU7rTlC0Z
         PM+b3Lz+DmEoaon3P/q09WKupmVCH7oatBDL7FOybJ3pXzkjhtzMPP7x/R1xU/DQGXu0
         nfwBsa8fyaiEIgtmh+3cjPbOxb7NTmCIxikLHJFvf15xJ7M6K5WizEcHcSv6xQIFLHMo
         jd0EzQ8ex4FJ4kLD9zxEVs0ioHvf1h1tPbEfmdS64q9xQYsseNBTk+2B5ayH1f0msiyF
         MdZjQ5b9HyEj2IsY9U/9oPxtfCm2yfZTB4/a8NZoMwjP5efoXqy4nobxfYY7O+seNiNg
         jxow==
X-Original-Authentication-Results: mx.google.com;       spf=none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
X-Received: by 10.152.30.6 with SMTP id o6mr68450945lah.64.1420044811439;
        Wed, 31 Dec 2014 08:53:31 -0800 (PST)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.114.181.147 with SMTP id dw19csp2534944ldc;
        Wed, 31 Dec 2014 08:53:30 -0800 (PST)
X-Received: by 10.112.140.196 with SMTP id ri4mr36743863lbb.55.1420044809780;
        Wed, 31 Dec 2014 08:53:29 -0800 (PST)
Authentication-Results: mx.google.com;
       spf=none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
Received-SPF: none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) client-ip=91.198.169.61;
Received: by 10.112.74.9 with POP3 id p9mf14559114lbv.23;
        Wed, 31 Dec 2014 08:53:29 -0800 (PST)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-n.one.com (mx-n.one.com [91.198.169.61])
	by mail6.local.one.com (Postfix) with ESMTP id BB8D030027E501
	for <info@awaresystems.be>; Wed, 31 Dec 2014 16:05:21 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx-n.one.com (Postfix) with ESMTP id 960F421A2CFF6
	for <info@awaresystems.be>; Wed, 31 Dec 2014 16:05:21 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id E99C635C05C;
	Wed, 31 Dec 2014 11:04:30 -0500 (EST)
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by lists.maptools.org (Postfix) with ESMTPS id C56B535C025
	for <tiff@lists.maptools.org>; Wed, 31 Dec 2014 11:04:02 -0500 (EST)
Received: from freddy.simplesystems.org (freddy.simplesystems.org
	[65.66.246.65])
	by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id
	sBVG474o021901; Wed, 31 Dec 2014 10:04:07 -0600 (CST)
Date: Wed, 31 Dec 2014 10:04:07 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@freddy.simplesystems.org
To: Olivier Paquet <olivier.paquet@gmail.com>
In-Reply-To: <CAAcuQeYoapa-7CJ==3km+i3EWrCxU66i3jSSViSd--tc4_VMVw@mail.gmail.com>
Message-ID: <alpine.GSO.2.01.1412310958020.18732@freddy.simplesystems.org>
References: <54A30DF9.4090109@gmail.com>
	<1419972943.29851.19.camel@t-online.de>
	<CAAcuQeYoapa-7CJ==3km+i3EWrCxU66i3jSSViSd--tc4_VMVw@mail.gmail.com>
User-Agent: Alpine 2.01 (GSO 1266 2009-07-14)
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(blade.simplesystems.org [65.66.246.90]);
	Wed, 31 Dec 2014 10:04:07 -0600 (CST)
Cc: "Yuriy M. Kaminskiy" <yumkam@gmail.com>,
	TIFF mailing list <tiff@lists.maptools.org>
Subject: Re: [Tiff] [PATCH] tif_luv, tif_pixarlog,
 ppm2tiff: get rid of duplicates of TIFFSafeMultiply
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Wed, 31 Dec 2014, Olivier Paquet wrote:
>
> I'm fairly certain it covers all possible overflows and nothing else.
> If no one objects, I will make both changes.

Whatever is done, it would be good if the approach is normalized 
rather than creating many one-of solutions in the code.

There is value gained from using pre-processor macros in that they do 
not influence the values type.  Hard-coded functions may produce an 
unexpected result if the function prototype converts the input value 
to a different type.  For example, if size_t is assumed, then there 
could be a problem if the computation is intentionally using types 
larger than size_t, or a signed type.

Current libtiff CVS is modified from previous releases in that 
_TIFFmalloc() returns NULL if a zero-byte allocation is requested.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
