diff options
author | 2013-12-02 03:09:22 +0000 | |
---|---|---|
committer | 2013-12-02 03:09:22 +0000 | |
commit | 46b440e50414a97965534e1ca130a531fa71b937 (patch) | |
tree | d9b8670d97a276ad49ba8fe8abaed5c8f15b4a89 | |
parent | use-after-free; bz#2175 patch from Loganaden Velvindron @ AfriNIC (diff) | |
download | wireguard-openbsd-46b440e50414a97965534e1ca130a531fa71b937.tar.xz wireguard-openbsd-46b440e50414a97965534e1ca130a531fa71b937.zip |
make key_to_blob() return a NULL blob on failure; part of
bz#2175 from Loganaden Velvindron @ AfriNIC
-rw-r--r-- | usr.bin/ssh/key.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c index e2ad6267032..8f4ea2386c9 100644 --- a/usr.bin/ssh/key.c +++ b/usr.bin/ssh/key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.105 2013/10/29 09:42:11 djm Exp $ */ +/* $OpenBSD: key.c,v 1.106 2013/12/02 03:09:22 djm Exp $ */ /* * read_bignum(): * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1531,6 +1531,10 @@ to_blob(const Key *key, u_char **blobp, u_int *lenp, int force_plain) Buffer b; int len, type; + if (blobp != NULL) + *blobp = NULL; + if (lenp != NULL) + *lenp = 0; if (key == NULL) { error("key_to_blob: key == NULL"); return 0; |