Re: prevent invalidly encoded input

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: prevent invalidly encoded input
Date: 2007-09-12 16:19:18
Message-ID: 23464.1189613958@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> addlitchar(unescape_single_char(yytext[1]));
> + if (IS_HIGHBIT_SET(literalbuf[literallen]))
> + saw_high_bit = true;

Isn't that array subscript off-by-one? Probably better to put the test
inside unescape_single_char(), anyway.

Otherwise it looks sane, though maybe shy a comment or so.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-09-12 16:37:45 Re: HOT documentation README
Previous Message Tom Lane 2007-09-12 15:31:39 Re: Rename latestCompletedXid to latestCommittedXid