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

Re: byteain bug(?)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joe Conway <joseph(dot)conway(at)home(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: byteain bug(?)
Date: 2001-09-07 04:02:56
Message-ID: 200109070402.f8742uG24004@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Should be fixed.  I noticed this myself.  Should we require three digits?


> 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
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-09-07 04:09:32
Subject: Re: byteain bug(?)
Previous:From: Tom LaneDate: 2001-09-07 03:56:16
Subject: Status of greatbridge.org

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