summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2025-05-28 12:55:15 -0400
committerTaylor Blau <me@ttaylorr.com>2025-05-28 12:55:15 -0400
commit2d22f0cd07c308d7ff25bbf4ec8f1bb53b4bcda7 (patch)
tree2f0075729780e39a72abf7da71d18fa9082e3e34 /config.c
parentd2bc61fcabd6cfa582d286bed1ce20d5d7c58d52 (diff)
parent05e9cd64ee23bbadcea6bcffd6660ed02b8eab89 (diff)
downloadgit-2d22f0cd07c308d7ff25bbf4ec8f1bb53b4bcda7.tar.xz
Merge branch 'jt/config-quote-cr' into maint-2.43
This merges in the fix for CVE-2025-48384. * jt/config-quote-cr: config: quote values containing CR character Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/config.c b/config.c
index 9ff6ae1cb9..629981451d 100644
--- a/config.c
+++ b/config.c
@@ -2999,7 +2999,7 @@ static ssize_t write_pair(int fd, const char *key, const char *value,
if (value[0] == ' ')
quote = "\"";
for (i = 0; value[i]; i++)
- if (value[i] == ';' || value[i] == '#')
+ if (value[i] == ';' || value[i] == '#' || value[i] == '\r')
quote = "\"";
if (i && value[i - 1] == ' ')
quote = "\"";