1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
From 2ad2eb4a1fe56d921957c1a29db4b3a5fd9be89f Mon Sep 17 00:00:00 2001
From: "Pavel I. Kryukov" <kryukov@frtk.ru>
Date: Sat, 22 Sep 2018 14:37:24 +0300
Subject: Remove a fixed-size buffer in cmdgen.c.
This patch solves the same problem as in previous commit:
the fixed-size buffer may have less size than data placed into it.
Origin: upstream, https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ed70e6014cbe43baf5d5e0c3261c4d99e6bc9473
Last-Update: 2018-10-28
Patch-Name: cmdgen-fixed-size-buffer.patch
---
cmdgen.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/cmdgen.c b/cmdgen.c
index 9d9d011a..028d13a2 100644
--- a/cmdgen.c
+++ b/cmdgen.c
@@ -1299,14 +1299,15 @@ int main(int argc, char **argv)
setup_passphrases(NULL);
test(0, "puttygen", "-L", filename, "-o", pubfilename, NULL);
{
- char cmdbuf[256];
+ char *cmdbuf;
fp = NULL;
- sprintf(cmdbuf, "ssh-keygen -l -f '%s' > '%s'",
+ cmdbuf = dupprintf("ssh-keygen -l -f '%s' > '%s'",
pubfilename, tmpfilename1);
if (system(cmdbuf) ||
(fp = get_fp(tmpfilename1)) == NULL) {
printf("UNABLE to test fingerprint matching against OpenSSH");
}
+ sfree(cmdbuf);
}
/*
|