Skip to content

Commit 0cc3b12

Browse files
committed
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
1 parent 22f9b3d commit 0cc3b12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/psqlscan.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,8 @@ psql_scan_slash_option(PsqlScanState state,
15561556
/* Keep the first quote, remove the second */
15571557
cp++;
15581558
}
1559-
inquotes = !inquotes;
1559+
else
1560+
inquotes = !inquotes;
15601561
/* Collapse out quote at *cp */
15611562
memmove(cp, cp + 1, strlen(cp));
15621563
mybuf.len--;

0 commit comments

Comments
 (0)