Re: crypt and null termination - Mailing list pgsql-hackers

From Tom Lane
Subject Re: crypt and null termination
Date
Msg-id 27979.998016681@sss.pgh.pa.us
Whole thread Raw
In response to crypt and null termination  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: crypt and null termination
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> It seems to say that the salt passed to crypt should be null-terminated,

Hmm.  The HPUX man page for crypt() just says thatsalt is a two-character string chosen from the set [a-zA-Z0-9./]
which I think is the traditional spec.  Looks like BSD has adopted some
local extensions.

Note that the BSD page specifies that the extended salt format starts
with '_', which is not one of the allowed characters in the traditional
format.  I bet they check that before trying to fetch more than 2 bytes.
The second paragraph you quote doesn't say anything about null
termination.

Still, it wouldn't be a bad idea to add a null byte ... couldn't hurt.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rough idea for supporting "sequencename.nextval" syntax
Next
From: Doug McNaught
Date:
Subject: Re: crypt and null termination