summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2016-08-08 10:07:46 -0400
committerNoah Misch <noah@leadboat.com>2016-08-08 10:07:53 -0400
commitaed766ab55c7d0f25653427789f78a6e12c2ae7b (patch)
treea5f0471f4dae7f3ba70f317db2c13b49056f28b2 /src
parente8ccfaf86f410e86730ea02a0d66040fb458ab46 (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
Diffstat (limited to 'src')
-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 8cef0f248f0..303ce4d3b9f 100644
--- a/src/bin/psql/psqlscan.l
+++ b/src/bin/psql/psqlscan.l
@@ -1616,7 +1616,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--;