diff options
author | Jeremy Allison <jra@samba.org> | 2012-03-28 16:49:30 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-03-29 20:48:15 +0200 |
commit | 5df1c115391f2d673d3dd2dfb89146ce77639d41 (patch) | |
tree | 6476e3ef1ad04b57f230f4f4167e04e020bce111 /lib/socket/interfaces.c | |
parent | 762928945d8c18abbce1447fb0e731a4515ffb4c (diff) | |
download | samba-5df1c115391f2d673d3dd2dfb89146ce77639d41.tar.gz samba-5df1c115391f2d673d3dd2dfb89146ce77639d41.tar.xz samba-5df1c115391f2d673d3dd2dfb89146ce77639d41.zip |
Start to add truncate checks on all uses of strlcpy(). Reading lwn
has it's uses :-).
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 29 20:48:15 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib/socket/interfaces.c')
-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 775956ba990..74c642372a2 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++; } |