diff options
author | 2013-12-02 02:56:17 +0000 | |
---|---|---|
committer | 2013-12-02 02:56:17 +0000 | |
commit | 395d12006571e738eea4dfc3b8d67e6f11a7309f (patch) | |
tree | 3b2fc2ed77330a4feed7401aba12fa9cd657ca6f | |
parent | typo; from Jon Cave (diff) | |
download | wireguard-openbsd-395d12006571e738eea4dfc3b8d67e6f11a7309f.tar.xz wireguard-openbsd-395d12006571e738eea4dfc3b8d67e6f11a7309f.zip |
use-after-free; bz#2175 patch from Loganaden Velvindron @ AfriNIC
-rw-r--r-- | usr.bin/ssh/ssh-pkcs11-helper.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-pkcs11-helper.c b/usr.bin/ssh/ssh-pkcs11-helper.c index b9fce86e7ab..80e4dd3b385 100644 --- a/usr.bin/ssh/ssh-pkcs11-helper.c +++ b/usr.bin/ssh/ssh-pkcs11-helper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-pkcs11-helper.c,v 1.6 2013/05/17 00:13:14 djm Exp $ */ +/* $OpenBSD: ssh-pkcs11-helper.c,v 1.7 2013/12/02 02:56:17 djm Exp $ */ /* * Copyright (c) 2010 Markus Friedl. All rights reserved. * @@ -120,7 +120,8 @@ process_add(void) buffer_put_char(&msg, SSH2_AGENT_IDENTITIES_ANSWER); buffer_put_int(&msg, nkeys); for (i = 0; i < nkeys; i++) { - key_to_blob(keys[i], &blob, &blen); + if (key_to_blob(keys[i], &blob, &blen) == 0) + continue; buffer_put_string(&msg, blob, blen); buffer_put_cstring(&msg, name); free(blob); |