From: Davide Galassi Date: Fri, 2 Dec 2016 16:10:37 +0000 (+0100) Subject: Avoid the call to OPENSSL_malloc with a negative value (then casted to unsigned) X-Git-Tag: OpenSSL_1_1_0d~85 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a08ae8fee9539ed1432f4169cea46f6e27990dd5;p=oweals%2Fopenssl.git Avoid the call to OPENSSL_malloc with a negative value (then casted to unsigned) CLA: trivial Reviewed-by: Matt Caswell Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2021) (cherry picked from commit 210fe4edee6514e4c1f0677adc9112c4459da02b) --- diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index 52816dfb9d..f58237d64b 100644 --- a/crypto/dso/dso_lib.c +++ b/crypto/dso/dso_lib.c @@ -324,6 +324,9 @@ DSO *DSO_dsobyaddr(void *addr, int flags) char *filename = NULL; int len = DSO_pathbyaddr(addr, NULL, 0); + if (len < 0) + return NULL; + filename = OPENSSL_malloc(len); if (filename != NULL && DSO_pathbyaddr(addr, filename, len) == len)