From: Sebastian Harl Date: Tue, 30 Oct 2012 06:41:20 +0000 (+0100) Subject: CData: Fixed handling of whitespace + garbage detection at end of input. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bd4264e5207bc2ad88906d53f58e48cbd0a1dfa3;p=postrr.git CData: Fixed handling of whitespace + garbage detection at end of input. WTF happened there?!? ;-) --- diff --git a/src/cdata.c b/src/cdata.c index 7ee14e6..021ba1a 100644 --- a/src/cdata.c +++ b/src/cdata.c @@ -160,9 +160,13 @@ cdata_in(PG_FUNCTION_ARGS) )); while ((*endptr != '\0') && isspace((int)*endptr)) + ++endptr; + + if (*endptr != '\0') ereport(ERROR, ( errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for cdata: \"%s\"", orig) + errmsg("invalid input syntax for cdata: \"%s\"", orig), + errhint("garbage found after number: \"%s\"", endptr) )); if (typmod > 0)