Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Fix potential null deref in htp__strndup_
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFrench committed Sep 9, 2017
1 parent fc739df commit 60b85ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions evhtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ htp__strndup_(const char * str, size_t len)
if ((p = malloc_(len + 1)) != NULL)
{
memcpy(p, str, len + 1);
} else {
return NULL;
}

p[len] = '\0';
Expand Down

0 comments on commit 60b85ca

Please sign in to comment.