Skip site navigation (1) Skip section navigation (2)

Re: BUG #5243: Segmentation fault when sending null to crypt();

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Greg Johnson" <greg(dot)johnson(at)interprose(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5243: Segmentation fault when sending null to crypt();
Date: 2009-12-14 18:40:13
Message-ID: 11687.1260816013@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Greg Johnson" <greg(dot)johnson(at)interprose(dot)com> writes:
> Postgresql version 8.4.1 and 8.3.8 both seg fault when you pass null into
> crypt function.

> select crypt(null, gen_salt('md5'));

Not if the crypt function is properly defined:

CREATE OR REPLACE FUNCTION crypt(text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'pg_crypt'
LANGUAGE C IMMUTABLE STRICT;

The CVS history shows that the STRICT marker was added in 8.1.
If you are still using pre-8.1 definitions of the pgcrypto
functions (no doubt via a long chain of dump/reload), you really need to
update them to current, because you're missing a lot of functionality.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Robert HaasDate: 2009-12-15 03:06:52
Subject: Re: Invalid explain output for multi-plan statements
Previous:From: Greg JohnsonDate: 2009-12-14 18:20:07
Subject: BUG #5243: Segmentation fault when sending null to crypt();

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group