Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Due to a quirk (err, bug?) in IP Filter (mbuf fr...



details:   https://anonhg.NetBSD.org/src/rev/cc718cd6c2a0
branches:  trunk
changeset: 499137:cc718cd6c2a0
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Nov 12 19:50:47 2000 +0000

description:
Due to a quirk (err, bug?) in IP Filter (mbuf freed without setting *mp
to NULL), the NULL check is insufficient.  Also make sure fr_check()
returned 0.

diffstat:

 sys/netinet/fil.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 12e2723045a3 -r cc718cd6c2a0 sys/netinet/fil.c
--- a/sys/netinet/fil.c Sun Nov 12 19:48:55 2000 +0000
+++ b/sys/netinet/fil.c Sun Nov 12 19:50:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.42 2000/11/12 19:29:31 thorpej Exp $ */
+/*     $NetBSD: fil.c,v 1.43 2000/11/12 19:50:47 thorpej Exp $ */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -9,7 +9,7 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: fil.c,v 1.42 2000/11/12 19:29:31 thorpej Exp $";
+static const char rcsid[] = "$NetBSD: fil.c,v 1.43 2000/11/12 19:50:47 thorpej Exp $";
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 2.35.2.19 2000/07/27 13:08:18 darrenr Exp";
@@ -737,7 +737,7 @@
 
        rv = fr_check(ip, hlen, ifp, (dir == PFIL_OUT), mp);
 
-       if (*mp != NULL) {
+       if (rv == 0 && *mp != NULL) {
                ip = mtod(*mp, struct ip *);
                HTONS(ip->ip_len);
                HTONS(ip->ip_off);



Home | Main Index | Thread Index | Old Index