summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch2016-08-08 14:07:46 +0000
committerNoah Misch2016-08-08 14:07:52 +0000
commit0cc3b12d284fb0e693abfd24e3950a19d3478380 (patch)
treeaa8788fec4f28f5e11034b5e5a8440f3f52e1dc7
parent22f9b3dd3d92fa3f8f250c3cca468e6c27ca2b34 (diff)
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
-rw-r--r--src/bin/psql/psqlscan.l3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l
index a3d569f13db..d726509dc41 100644
--- a/src/bin/psql/psqlscan.l
+++ b/src/bin/psql/psqlscan.l
@@ -1556,7 +1556,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--;