upstream: fix null-deref on calloc failure; ok djm

OpenBSD-Commit-ID: a313519579b392076b7831ec022dfdefbec8724a
This commit is contained in:
markus@openbsd.org 2020-03-06 18:15:38 +00:00 committed by Damien Miller
parent ff2acca039
commit 5f25afe521
1 changed files with 6 additions and 4 deletions

View File

@ -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> * Copyright (c) 2018 Damien Miller <djm@mindrot.org>
* *
@ -734,9 +734,11 @@ deserialise_array(struct sshbuf *m, char ***ap, size_t *np)
*np = n; *np = n;
n = 0; n = 0;
out: out:
for (i = 0; i < n; i++) if (a != NULL) {
free(a[i]); for (i = 0; i < n; i++)
free(a); free(a[i]);
free(a);
}
sshbuf_free(b); sshbuf_free(b);
return r; return r;
} }