summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorNoah Misch2016-08-08 14:07:46 +0000
committerNoah Misch2016-08-08 14:07:46 +0000
commit984e5beb38a7c79a5a9243865d9598c405df17f6 (patch)
treec2e1d48a600a1bb28764765bd4e0ce13b387172d /src/bin
parenta1f8b6bd14adb724365d91dcc58079ac3a2293e7 (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/bin')
-rw-r--r--src/bin/psql/psqlscanslash.l3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/psql/psqlscanslash.l b/src/bin/psql/psqlscanslash.l
index 90854afeb0e..86832a86532 100644
--- a/src/bin/psql/psqlscanslash.l
+++ b/src/bin/psql/psqlscanslash.l
@@ -671,7 +671,8 @@ dequote_downcase_identifier(char *str, bool downcase, int encoding)
/* Keep the first quote, remove the second */
cp++;
}
- inquotes = !inquotes;
+ else
+ inquotes = !inquotes;
/* Collapse out quote at *cp */
memmove(cp, cp + 1, strlen(cp));
/* do not advance cp */