Re: BUG #4791: NULL value in function causes reproducible segmentation fault - Mailing list pgsql-bugs

From Magnus Hagander
Subject Re: BUG #4791: NULL value in function causes reproducible segmentation fault
Date
Msg-id 4A0008EB.1060802@hagander.net
Whole thread Raw
In response to BUG #4791: NULL value in function causes reproducible segmentation fault  ("Sikkerhed.org ApS" <support@sikkerhed.org>)
Responses Re: BUG #4791: NULL value in function causes reproducible segmentation fault  (Christian Iversen <ci@sikkerhed.org>)
List pgsql-bugs
Sikkerhed.org ApS wrote:
> The following bug has been logged online:
>
> Bug reference:      4791
> Logged by:          Sikkerhed.org ApS
> Email address:      support@sikkerhed.org
> PostgreSQL version: 8.3.7-0lenny1
> Operating system:   Debian GNU/Linux 5.0.1 stable (fully updated)
> Description:        NULL value in function causes reproducible segmentation
> fault
> Details:
>
> We are using a couple of functions in PostgreSQL, namely
>
> CREATE OR REPLACE FUNCTION digest(text, text) RETURNS bytea AS
> '$libdir/pgcrypto', 'pg_digest' LANGUAGE 'C';

This declaration is incorrect. The function is from pgcrypto, and the
pgcrypto declaration is:
CREATE OR REPLACE FUNCTION digest(text, text)
RETURNS bytea
AS '$libdir/pgcrypto', 'pg_digest'
LANGUAGE C IMMUTABLE STRICT;


Notice the "immutable script" part that you are missing.

Any particular reason why you are not using the pgcrypto installation
script?

//Magnus

pgsql-bugs by date:

Previous
From: "Sikkerhed.org ApS"
Date:
Subject: BUG #4791: NULL value in function causes reproducible segmentation fault
Next
From: "toni garcia"
Date:
Subject: BUG #4792: odd behavior revoking perms on an owned table