Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BFC358B63D8 for ; Wed, 20 Jun 2012 13:02:59 -0300 (ADT) Received: from gauss.credativ.com ([93.94.130.89]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShNMu-00011D-Dg for pgsql-bugs@postgresql.org; Wed, 20 Jun 2012 16:02:58 +0000 Received: from feivel (exit.credativ.com [87.139.82.80]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mme@gauss.credativ.com) by gauss.credativ.com (Postfix) with ESMTPSA id EE6E15580A7; Wed, 20 Jun 2012 18:02:42 +0200 (CEST) Received: by feivel (Postfix, from userid 1000) id 6E081A4728; Wed, 20 Jun 2012 18:02:42 +0200 (CEST) Date: Wed, 20 Jun 2012 18:02:42 +0200 From: Michael Meskes To: msrbugzilla@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6700: Potential Bug in numeric.c Message-ID: <20120620160242.GA12024@feivel.credativ.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/173 X-Sequence-Number: 33400 On Wed, Jun 20, 2012 at 05:53:14AM +0000, msrbugzilla@gmail.com wrote: > I observed a code clone in the following files. In the function > PGTYPESnumeric_copy, the variable dst is ensured to be not NULL before > passing to zero_var(). However, the function PGTYPESnumeric_from_decima= l > does not perform this checking. It will cause an exception when dst is = NULL > and passed to zero_var(). To be honest most of the functions do not check if the parameters are ind= eed set. Of course we could easily add the chekc for variable !=3D NULL but t= hat doesn't ensure that variable points to a valid numeric datatype. Suggesti= ons? Michael --=20 Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org Jabber: michael.meskes at googlemail dot com VfL Borussia! For=C3=A7a Bar=C3=A7a! Go SF 49ers! Use Debian GNU/Linux, P= ostgreSQL