summaryrefslogtreecommitdiff
path: root/lib/socket
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2016-02-03 11:41:23 +0100
committerMichael Adam <obnox@samba.org>2016-02-13 13:14:13 +0100
commit8b36428b195f6e1d1063f1abccb718f2665d271f (patch)
treeb9e456cf99c682c00debeccc85c129487b5d6339 /lib/socket
parent92afa1b165841356d6a3fb2ac44d9a5460bffea5 (diff)
downloadsamba-8b36428b195f6e1d1063f1abccb718f2665d271f.tar.gz
lib:socket: fix CID 1350009 - illegal memory accesses (BUFFER_SIZE_WARNING)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11735 Pair-Programmed-With: Guenther Deschner <gd@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'lib/socket')
-rw-r--r--lib/socket/interfaces.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c
index cf094f0b4c5..847fa6255ba 100644
--- a/lib/socket/interfaces.c
+++ b/lib/socket/interfaces.c
@@ -140,6 +140,11 @@ static void query_iface_speed_from_name(const char *name, uint64_t *speed)
return;
}
+ if (strlen(name) >= IF_NAMESIZE) {
+ DBG_ERR("Interface name too long.");
+ goto done;
+ }
+
strncpy(ifr.ifr_name, name, IF_NAMESIZE);
ifr.ifr_data = (void *)&edata;