Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 CID 977389: Out of bounds access.



details:   https://anonhg.NetBSD.org/src/rev/613fb473004b
branches:  trunk
changeset: 334002:613fb473004b
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 25 19:51:17 2014 +0000

description:
CID 977389: Out of bounds access.

diffstat:

 sys/netinet6/icmp6.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 3753a9925058 -r 613fb473004b sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Tue Nov 25 19:48:24 2014 +0000
+++ b/sys/netinet6/icmp6.c      Tue Nov 25 19:51:17 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.169 2014/06/06 01:02:47 rmind Exp $        */
+/*     $NetBSD: icmp6.c,v 1.170 2014/11/25 19:51:17 christos Exp $     */
 /*     $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.169 2014/06/06 01:02:47 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.170 2014/11/25 19:51:17 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -722,6 +722,8 @@
                        n->m_pkthdr.rcvif = NULL;
                        n->m_len = 0;
                        maxhlen = M_TRAILINGSPACE(n) - ICMP6_MAXLEN;
+                       if (maxhlen < 0)
+                               break;
                        if (maxhlen > hostnamelen)
                                maxhlen = hostnamelen;
                        /*



Home | Main Index | Thread Index | Old Index