Commit a08ae8fe authored by Davide Galassi's avatar Davide Galassi Committed by Rich Salz
Browse files

Avoid the call to OPENSSL_malloc with a negative value (then casted to unsigned)



CLA: trivial
Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2021)
(cherry picked from commit 210fe4ed)
parent a3a4bb74
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)