emacs/backport-0002-CVE-2022-48337.patch
2023-09-25 14:16:24 +08:00

26 lines
824 B
Diff

From c6ece14812f32a7f9f0d69497c886d178730a75f Mon Sep 17 00:00:00 2001
From: Super User <root@localhost.localdomain>
Date: Mon, 25 Sep 2023 14:14:02 +0800
Subject: [PATCH] backport 0002 CVE-2022-48337
---
lib-src/etags.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index a6bd7f6..ea80ba6 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1714,6 +1714,8 @@ process_file_name (char *file, language *lang)
int buf_len = strlen (compr->command) + strlen (" > ") + strlen (new_real_name) + strlen (new_tmp_name) + 1;
char *cmd = xmalloc (buf_len);
snprintf (cmd, buf_len, "%s %s > %s", compr->command, new_real_name, new_tmp_name);
+ free (new_real_name);
+ free (new_tmp_name);
#endif
inf = (system (cmd) == -1
? NULL
--
2.41.0