1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-22 21:53:06 +03:00

Disable the use of Unicode escapes in string constants (U&'') when

standard_conforming_strings is not on, for security reasons.
This commit is contained in:
Peter Eisentraut
2009-05-05 18:32:17 +00:00
parent 616bceb8cb
commit 40bc4c2605
4 changed files with 76 additions and 2 deletions

View File

@@ -24,7 +24,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.151 2009/04/19 21:08:54 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.152 2009/05/05 18:32:17 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -469,6 +469,11 @@ other .
startlit();
}
{xusstart} {
if (!standard_conforming_strings)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("unsafe use of string constant with Unicode escapes"),
errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off.")));
SET_YYLLOC();
BEGIN(xus);
startlit();