This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-763-g2180fee


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2180fee114b778515b3f560e5ff1e795282e60b0 (commit)
      from  cad7ca390879f2a8250e58bf5009a00b887a19b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2180fee114b778515b3f560e5ff1e795282e60b0

commit 2180fee114b778515b3f560e5ff1e795282e60b0
Author: Steve Ellcey <sellcey@caviumnetworks.com>
Date:   Wed Nov 15 08:58:48 2017 -0800

    Check length of ifname before copying it into to ifreq structure.
    
    	[BZ #22442]
    	* sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
    	Check if ifname is too long.

diff --git a/ChangeLog b/ChangeLog
index c26eac8..e10db60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-15  Steve Ellcey  <sellcey@cavium.com>
+
+	[BZ #22442]
+	* sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+	Check if ifname is too long.
+
 2017-11-15  Luke Shumaker  <lukeshu@parabola.nu>
 
 	* sysdeps/unix/sysv/linux/epoll_wait.c: Include <sysdep-cancel.h>.
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index 56f3f13..e7ca27b 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -43,6 +43,12 @@ __if_nametoindex (const char *ifname)
   if (fd < 0)
     return 0;
 
+  if (strlen (ifname) >= IFNAMSIZ)
+    {
+      __set_errno (ENODEV);
+      return 0;
+    }
+
   strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
   if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
     {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                          |    6 ++++++
 sysdeps/unix/sysv/linux/if_index.c |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]