diff options
author | markus@openbsd.org <markus@openbsd.org> | 2020-03-06 19:15:38 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-03-13 03:13:30 +0100 |
commit | 5f25afe5216ba7f8921e04f79aa4ca0624eca820 (patch) | |
tree | 2de832afedadabfc30a9df9d371af68b823cb258 /auth-options.c | |
parent | upstream: exit if ssh_krl_revoke_key_sha256 fails; ok djm (diff) | |
download | openssh-5f25afe5216ba7f8921e04f79aa4ca0624eca820.tar.xz openssh-5f25afe5216ba7f8921e04f79aa4ca0624eca820.zip |
upstream: fix null-deref on calloc failure; ok djm
OpenBSD-Commit-ID: a313519579b392076b7831ec022dfdefbec8724a
Diffstat (limited to 'auth-options.c')
-rw-r--r-- | auth-options.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/auth-options.c b/auth-options.c index b63782de7..696ba6ac6 100644 --- a/auth-options.c +++ b/auth-options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.91 2020/02/26 13:40:09 jsg Exp $ */ +/* $OpenBSD: auth-options.c,v 1.92 2020/03/06 18:15:38 markus Exp $ */ /* * Copyright (c) 2018 Damien Miller <djm@mindrot.org> * @@ -734,9 +734,11 @@ deserialise_array(struct sshbuf *m, char ***ap, size_t *np) *np = n; n = 0; out: - for (i = 0; i < n; i++) - free(a[i]); - free(a); + if (a != NULL) { + for (i = 0; i < n; i++) + free(a[i]); + free(a); + } sshbuf_free(b); return r; } |