diff --git a/lib/roken/hex.c b/lib/roken/hex.c index b5ce01e36..68c18a4eb 100644 --- a/lib/roken/hex.c +++ b/lib/roken/hex.c @@ -60,8 +60,10 @@ hex_encode(const void *data, size_t size, char **str) char *p; /* check for overflow */ - if (size * 2 < size) + if (size * 2 < size) { + *str = NULL; return -1; + } p = malloc(size * 2 + 1); if (p == NULL) {