diff options
Diffstat (limited to 'lib/socket')
-rw-r--r-- | lib/socket/interfaces.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c index 775956ba99..74c642372a 100644 --- a/lib/socket/interfaces.c +++ b/lib/socket/interfaces.c @@ -212,8 +212,12 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) continue; } - strlcpy(ifaces[total].name, ifptr->ifa_name, - sizeof(ifaces[total].name)); + if (strlcpy(ifaces[total].name, ifptr->ifa_name, + sizeof(ifaces[total].name)) >= + sizeof(ifaces[total].name)) { + /* Truncation ! Ignore. */ + continue; + } total++; } |