Source-Changes-HG archive

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

[src/trunk]: src/sys/net/lagg Added missing NULL check



details:   https://anonhg.NetBSD.org/src/rev/32b95a287fae
branches:  trunk
changeset: 364591:32b95a287fae
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Mar 31 01:43:48 2022 +0000

description:
Added missing NULL check

pointed out by k-goda@IIJ

diffstat:

 sys/net/lagg/if_lagg.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 6ddef653f96b -r 32b95a287fae sys/net/lagg/if_lagg.c
--- a/sys/net/lagg/if_lagg.c    Thu Mar 31 01:42:40 2022 +0000
+++ b/sys/net/lagg/if_lagg.c    Thu Mar 31 01:43:48 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_lagg.c,v 1.32 2022/03/31 01:42:40 yamaguchi Exp $   */
+/*     $NetBSD: if_lagg.c,v 1.33 2022/03/31 01:43:48 yamaguchi Exp $   */
 
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter <reyk%openbsd.org@localhost>
@@ -20,7 +20,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.32 2022/03/31 01:42:40 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.33 2022/03/31 01:43:48 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2613,6 +2613,10 @@
 
        bound = curlwp_bind();
        var = lagg_variant_getref(sc, &psref);
+       if (var == NULL) {
+               curlwp_bindx(bound);
+               return ENOENT;
+       }
 
        resp->lrq_proto = var->lv_proto;
 



Home | Main Index | Thread Index | Old Index