Skip to content

Commit

Permalink
Fix: core dump caused by IPv6 address formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
semigodking committed Feb 27, 2020
1 parent dad894d commit c23af86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ char *red_inet_ntop(const struct sockaddr_storage* sa, char* buffer, size_t buff
buffer[0] = '[';
retval = inet_ntop(AF_INET6, &((const struct sockaddr_in6*)sa)->sin6_addr, buffer+1, buffer_size-1);
port = ((struct sockaddr_in6*)sa)->sin6_port;
if (retval)
retval = buffer;
}
if (retval) {
assert(retval == buffer);
Expand Down

0 comments on commit c23af86

Please sign in to comment.