diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index 8f185b38283cd..ec3c59ac4d222 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)