Browse code

core: 0-terminate string for very long local network interface names

Daniel-Constantin Mierla authored on 16/03/2022 08:04:33
Showing 1 changed files
... ...
@@ -1333,6 +1333,7 @@ static int build_iface_list(void)
1333 1333
 					case IFA_LABEL:
1334 1334
 						LM_DBG("iface name is %s\n", (char*)RTA_DATA(rtap));
1335 1335
 						strncpy(name, (char*)RTA_DATA(rtap), MAX_IF_LEN-1);
1336
+						name[MAX_IF_LEN-1] = '\0';
1336 1337
 						break;
1337 1338
 					case IFA_BROADCAST:
1338 1339
 					case IFA_ANYCAST: