diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2009-05-05 18:32:17 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2009-05-05 18:32:17 +0000 |
commit | 40bc4c260508e8a2579bd2106e1f81b6795d147b (patch) | |
tree | d2ad86c55d2795e0746a56f93d0c56852b315147 /src/backend/parser | |
parent | 616bceb8cb67c4f7641d933d0963373963e7492e (diff) | |
download | postgresql-40bc4c260508e8a2579bd2106e1f81b6795d147b.tar.gz postgresql-40bc4c260508e8a2579bd2106e1f81b6795d147b.zip |
Disable the use of Unicode escapes in string constants (U&'') when
standard_conforming_strings is not on, for security reasons.
Diffstat (limited to 'src/backend/parser')
-rw-r--r-- | src/backend/parser/scan.l | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index 8551cd27538..eb0fc10c8f3 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -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(); |