byteain bug(?) - Mailing list pgsql-hackers

From Joe Conway
Subject byteain bug(?)
Date
Msg-id 01d601c1374a$cbf47df0$0705a8c0@jecw2k1
Whole thread Raw
Responses Re: byteain bug(?)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: byteain bug(?)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I just noticed some unexpected behavior from byteain:

test=# select '\\009'::bytea;?column?
----------\011
(1 row)

test=# select '\\444'::bytea;?column?
----------$
(1 row)

test=# select '\\999'::bytea;?column?
----------\221
(1 row)

The reason is the following code in byteain:
  else if (!isdigit((unsigned char) *tp++) ||     !isdigit((unsigned char) *tp++) ||     !isdigit((unsigned char)
*tp++))  elog(ERROR, "Bad input string for type bytea");
 

It checks for a '\' followed by three digits, but does not attempt to
enforce that the three digits actually produce a valid octal number. Anyone
object to me fixing this?

-- Joe




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: FTI contrib
Next
From: Tom Lane
Date:
Subject: Status of greatbridge.org