Client: Fix signature verification double free
authorPekka Riikonen <priikone@silcnet.org>
Tue, 25 May 2010 04:24:28 +0000 (07:24 +0300)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 25 May 2010 04:24:28 +0000 (07:24 +0300)
When client receives public key in the message payload and is compared
against the client's own public key, when the keys differ we have to
return immediately and not try to verify the signature.

apps/irssi/src/silc/core/client_ops.c

index cfefe3275300b7e98db354c1ec378c3128b751b9..a4d53b76504b981fcbf7a0a197225d8d4e2f0c2a 100644 (file)
@@ -262,10 +262,11 @@ int verify_message_signature(SilcClientEntry sender,
                                      sizeof(sender->fingerprint));
       if (strcmp(fingerprint, fingerprint2)) {
         /* since the public key differs from the senders public key, the
-           verification _failed_ */
+           verification won't be done */
         silc_pkcs_public_key_free(pk);
         silc_free(fingerprint);
-        ret = SILC_MSG_SIGNED_UNKNOWN;
+        silc_free(fingerprint2);
+       return SILC_MSG_SIGNED_UNKNOWN;
       }
       silc_free(fingerprint2);
     }