Source-Changes-HG archive

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

[src/trunk]: src/sbin/route 2-byte read overrun for unknown sockaddr. from o...



details:   https://anonhg.NetBSD.org/src/rev/f35153d46b89
branches:  trunk
changeset: 566634:f35153d46b89
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat May 15 13:41:09 2004 +0000

description:
2-byte read overrun for unknown sockaddr.  from openbsd
XXX out[64], is it safe?  what if sa_len > 23?

diffstat:

 sbin/route/route.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6ed605117c23 -r f35153d46b89 sbin/route/route.c
--- a/sbin/route/route.c        Fri May 14 22:07:21 2004 +0000
+++ b/sbin/route/route.c        Sat May 15 13:41:09 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.71 2004/01/05 23:23:33 jmmv Exp $  */
+/*     $NetBSD: route.c,v 1.72 2004/05/15 13:41:09 itojun Exp $        */
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)route.c    8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.71 2004/01/05 23:23:33 jmmv Exp $");
+__RCSID("$NetBSD: route.c,v 1.72 2004/05/15 13:41:09 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -364,7 +364,7 @@
        char *out;
        int len;
 
-       len = sa->sa_len;
+       len = sa->sa_len - offsetof(struct sockaddr, sa_data);
        in  = sa->sa_data;
        out = obuf;
 



Home | Main Index | Thread Index | Old Index