Module: kamailio
Branch: master
Commit: 476d763d8ee504b71c13063ca002ecfe158da94e
URL:
https://github.com/kamailio/kamailio/commit/476d763d8ee504b71c13063ca002ecf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-03-16T09:04:33+01:00
core: 0-terminate string for very long local network interface names
---
Modified: src/core/socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/476d763d8ee504b71c13063ca002ecf…
Patch:
https://github.com/kamailio/kamailio/commit/476d763d8ee504b71c13063ca002ecf…
---
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index afb1dd5603..00d7bdf289 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -1333,6 +1333,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: