pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: msrbugzilla@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6700: Potential Bug in numeric.c
Date: Wed, 20 Jun 2012 18:02:42 +0200
Message-ID: <20120620160242.GA12024@feivel.credativ.lan> (raw)
In-Reply-To: <E1ShDqs-0007Wj-My@wrigleys.postgresql.org>
References: <E1ShDqs-0007Wj-My@wrigleys.postgresql.org>

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_decimal
> 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 indeed
set. Of course we could easily add the chekc for variable != NULL but that
doesn't ensure that variable points to a valid numeric datatype. Suggestions?

Michael
-- 
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ça Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL



view thread (2+ messages)

Message-ID: <20120620160242.GA12024@feivel.credativ.lan>
Permalink:  ../20120620160242.GA12024@feivel.credativ.lan/
Also on:    postgresql.org/message-id/20120620160242.GA12024@feivel.credativ.lan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: meskes@postgresql.org, msrbugzilla@gmail.com
  Subject: Re: BUG #6700: Potential Bug in numeric.c
  In-Reply-To: <20120620160242.GA12024@feivel.credativ.lan>
  References: <E1ShDqs-0007Wj-My@wrigleys.postgresql.org> <20120620160242.GA12024@feivel.credativ.lan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox