Skip to content

Commit

Permalink
core: 0-terminate string for very long local network interface names
Browse files Browse the repository at this point in the history
(cherry picked from commit 476d763)
(cherry picked from commit 9083eb3)
  • Loading branch information
miconda committed Sep 15, 2022
1 parent 15e5708 commit 21c5ad0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/socket_info.c
Expand Up @@ -1263,6 +1263,7 @@ static int build_iface_list(void)
case IFA_LABEL:
LM_DBG("iface name is %s\n", (char*)RTA_DATA(rtap));
strncpy(name, (char*)RTA_DATA(rtap), MAX_IF_LEN-1);
name[MAX_IF_LEN-1] = '\0';
break;
case IFA_BROADCAST:
case IFA_ANYCAST:
Expand Down

0 comments on commit 21c5ad0

Please sign in to comment.