Source-Changes-HG archive

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

[src/trunk]: src/sys/net/npf PR/54950: Lloyd Parkes: Avoid NULL deref.



details:   https://anonhg.NetBSD.org/src/rev/c145f3302afb
branches:  trunk
changeset: 744746:c145f3302afb
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 12 01:34:55 2020 +0000

description:
PR/54950: Lloyd Parkes: Avoid NULL deref.

diffstat:

 sys/net/npf/npf_ruleset.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 73fdbbfa0a40 -r c145f3302afb sys/net/npf/npf_ruleset.c
--- a/sys/net/npf/npf_ruleset.c Wed Feb 12 01:10:25 2020 +0000
+++ b/sys/net/npf/npf_ruleset.c Wed Feb 12 01:34:55 2020 +0000
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_ruleset.c,v 1.49 2019/09/29 17:00:29 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_ruleset.c,v 1.50 2020/02/12 01:34:55 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -153,6 +153,9 @@
 void
 npf_ruleset_destroy(npf_ruleset_t *rlset)
 {
+       if (rlset == NULL)
+               return;
+
        size_t len = offsetof(npf_ruleset_t, rs_rules[rlset->rs_slots]);
        npf_rule_t *rl;
 



Home | Main Index | Thread Index | Old Index