git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ssh signing: don't detach the filename strbuf from key_file tempfile
@ 2025-07-04 23:08 redoste
  2025-07-05 19:21 ` Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: redoste @ 2025-07-04 23:08 UTC (permalink / raw)
  To: git; +Cc: redoste, Junio C Hamano, Fabian Stelzer, Elijah Newren

Detaching the filename string from the tempfile structure used to cause
delete_tempfile() to fail and the temporary file was not cleaned up.

Signed-off-by: redoste <redoste@redoste.xyz>
---
 gpg-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gpg-interface.c b/gpg-interface.c
index 0896458de5..bdcc8c2a2e 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -1048,7 +1048,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
 				    key_file->filename.buf);
 			goto out;
 		}
-		ssh_signing_key_file = strbuf_detach(&key_file->filename, NULL);
+		ssh_signing_key_file = xstrdup(key_file->filename.buf);
 	} else {
 		/* We assume a file */
 		ssh_signing_key_file = interpolate_path(signing_key, 1);
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-07-08 13:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04 23:08 [PATCH] ssh signing: don't detach the filename strbuf from key_file tempfile redoste
2025-07-05 19:21 ` Jeff King
2025-07-05 20:07   ` brian m. carlson
2025-07-05 22:50     ` redoste
2025-07-05 23:04       ` redoste
2025-07-06  0:28       ` brian m. carlson
2025-07-06  3:13         ` Jeff King
2025-07-06 17:20           ` redoste
2025-07-06 17:14         ` redoste
2025-07-06 17:34 ` [PATCH v2] " redoste
2025-07-06 21:21   ` brian m. carlson
2025-07-07  9:02   ` Patrick Steinhardt
2025-07-07  9:35     ` Phillip Wood
2025-07-07 14:25       ` redoste
2025-07-07 15:26         ` Phillip Wood
2025-07-07 16:22           ` redoste
2025-07-07 16:42             ` Phillip Wood
2025-07-07 18:48 ` [PATCH v3] " redoste
2025-07-07 20:57   ` Junio C Hamano
2025-07-08  6:47     ` Patrick Steinhardt
2025-07-08 13:59       ` Phillip Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).