]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
RDB points out that when you memset a newly allocated structure to
authorSimon Tatham <anakin@pobox.com>
Fri, 7 Sep 2001 22:52:51 +0000 (22:52 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 7 Sep 2001 22:52:51 +0000 (22:52 +0000)
zero, covering the size of the _structure_ rather than the size of
the pointer to it might help :-)

[originally from svn r1245]

pageant.c

index e00186398750d9be56c8ca84e43f8d6a3e9c4997..6ab373e194f3b0a5ce71a8d2771069d0ffac907f 100644 (file)
--- a/pageant.c
+++ b/pageant.c
@@ -652,7 +652,7 @@ static void answer_msg(void *msg)
            char *comment;
             int commentlen;
            key = smalloc(sizeof(struct RSAKey));
-           memset(key, 0, sizeof(key));
+           memset(key, 0, sizeof(struct RSAKey));
            p += makekey(p, key, NULL, 1);
            p += makeprivate(p, key);
            p += ssh1_read_bignum(p, &key->iqmp);       /* p^-1 mod q */