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

byteain bug(?)

From: "Joe Conway" <joseph(dot)conway(at)home(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: byteain bug(?)
Date: 2001-09-07 03:11:32
Message-ID: 01d601c1374a$cbf47df0$0705a8c0@jecw2k1 (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I just noticed some unexpected behavior from byteain:

test=# select '\\009'::bytea;
(1 row)

test=# select '\\444'::bytea;
(1 row)

test=# select '\\999'::bytea;
(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

Next:From: Marc G. FournierDate: 2001-09-07 03:32:12
Subject: pgsql/src/backend/utils/mb encnames.c win1251. ...
Previous:From: Tom LaneDate: 2001-09-07 02:40:42
Subject: Re: FTI contrib

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