Module: kamailio
Branch: master
Commit: 5cd4e817a24308b82fc3f631fb18f354dadf2b7e
URL:
https://github.com/kamailio/kamailio/commit/5cd4e817a24308b82fc3f631fb18f35…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-07-08T11:14:27+02:00
core: use memcpy and set end of string
---
Modified: src/core/socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5cd4e817a24308b82fc3f631fb18f35…
Patch:
https://github.com/kamailio/kamailio/commit/5cd4e817a24308b82fc3f631fb18f35…
---
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index 8c91e873fe..354cbc75b6 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -1551,7 +1551,8 @@ static int build_iface_list(void)
}
if(strlen(ifaces[index].name)==0 && strlen(name)>0) {
- strncpy(ifaces[index].name, name, MAX_IF_LEN-1);
+ memcpy(ifaces[index].name, name, MAX_IF_LEN-1);
+ ifaces[index].name[MAX_IF_LEN-1] = '\0';
}
ifaces[index].index = index;