Skip to content

Commit

Permalink
Avoid the call to OPENSSL_malloc with a negative value (then casted t…
Browse files Browse the repository at this point in the history
…o unsigned)

CLA: trivial
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from openssl#2021)
  • Loading branch information
Davide Galassi authored and Rich Salz committed Dec 10, 2016
1 parent eb43101 commit 210fe4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crypto/dso/dso_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 210fe4e

Please sign in to comment.