postgres.git / summary / log / commit / refs

commit    fed83cdac44da06915f9cf5926a282848841f7c1
Author:   Noah Misch <noah@leadboat.com>
Date:     Mon Aug 08 14:07:46 2016 +0000

    Sort out paired double quotes in \connect, \password and \crosstabview.
    
    In arguments, these meta-commands wrongly treated each pair as closing
    the double quoted string.  Make the behavior match the documentation.
    This is a compatibility break, but I more expect to find software with
    untested reliance on the documented behavior than software reliant on
    today's behavior.  Back-patch to 9.1 (all supported versions).
    
    Reviewed by Tom Lane and Peter Eisentraut.
    
    Security: CVE-2016-5424


src/bin/psql/psqlscan.l | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l index 9231459755b..5013b933635 100644 --- a/src/bin/psql/psqlscan.l +++ b/src/bin/psql/psqlscan.l @@ -1581,7 +1581,8 @@ psql_scan_slash_option(PsqlScanState state, /* Keep the first quote, remove the second */ cp++; } - inquotes = !inquotes; + else + inquotes = !inquotes; /* Collapse out quote at *cp */ memmove(cp, cp + 1, strlen(cp)); mybuf.len--; [parent: 682e172a61ae]