PRNG not seeded => Seg.Fault

Started by Stephen Pillingerover 24 years ago2 messagesbugs
Jump to latest
#1Stephen Pillinger
S.M.Pillinger@cs.bham.ac.uk

Hi there,
I think I may have discovered a minor but annoying bug in PostgreSQL.

PostgreSQL version 7.1.3
with openssl-0.9.6b
readline-4.2

Compiled under Solaris 8 with SPARCWorks compiler.

Started with command:

postmaster -D /export/pgsql/data -i -l

Attempting to connect via an SSL aware psql client machine that doesn't
have a PRNG seed causes the backend to generate a Segmentation Fault.

A little digging around found to culprit in

src/backend/postmaster/postmaster.c @ line 1115

the ERR_reason_error_string(ERR_get_error()) in the fprintf statement.

Remove it from the fprintf and all works fine.

Apart from that PostgreSQL is great!

Many thanks,

Steve

---------------------------------------------------------------------------
  Stephen Pillinger                       |  School of Computer Science,
  Senior Computer Officer                 |  The University of Birmingham,
  E-Mail: S.M.Pillinger@cs.bham.ac.uk     |  Edgbaston,
  Tel: 0121-414 3214  Fax: 0121-414 4281  |  Birmingham B15 2TT, UK.
+-------------------------------------------------------------------------+
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Pillinger (#1)
Re: PRNG not seeded => Seg.Fault

Stephen Pillinger <S.M.Pillinger@cs.bham.ac.uk> writes:

Attempting to connect via an SSL aware psql client machine that doesn't
have a PRNG seed causes the backend to generate a Segmentation Fault.

Well, removing all hope of reporting SSL-generated errors doesn't seem
like a good solution ;-) ... but evidently we need to guard against SSL
returning a NULL instead of an error string. Fix committed. Thanks
for the report!

regards, tom lane