From ae7901991bd093d961ec04ddb8d6763b6181099a Mon Sep 17 00:00:00 2001 From: mugitya03 Date: Sun, 9 Feb 2025 15:44:46 -0500 Subject: [PATCH 1/4] lib: fix a Null Pointer Dereference bug in mgmt_be_client.c Signed-off-by: mugitya03 --- lib/mgmt_be_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mgmt_be_client.c b/lib/mgmt_be_client.c index 806242ed5383..4943a2b6c3c1 100644 --- a/lib/mgmt_be_client.c +++ b/lib/mgmt_be_client.c @@ -323,6 +323,7 @@ static int __send_notification(struct mgmt_be_client *client, const char *xpath, int ret = 0; assert(op != NOTIFY_OP_NOTIFICATION || xpath || tree); + assert(xpath || tree); debug_be_client("%s: sending %sYANG %snotification: %s", __func__, op == NOTIFY_OP_DS_DELETE ? "delete " : op == NOTIFY_OP_DS_REPLACE ? "replace " From 91a704cb1ce9c7314a0da125b4e2227930ef444b Mon Sep 17 00:00:00 2001 From: mugitya03 Date: Sun, 9 Feb 2025 15:51:04 -0500 Subject: [PATCH 2/4] lib: fix a Null Pointer Dereference bug in vrf.c Signed-off-by: mugitya03 --- lib/vrf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vrf.c b/lib/vrf.c index 0b39d93602ef..a921a2939ed2 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -944,8 +944,9 @@ static int lib_vrf_create(struct nb_cb_create_args *args) return NB_OK; vrfp = vrf_get(VRF_UNKNOWN, vrfname); - - SET_FLAG(vrfp->status, VRF_CONFIGURED); + + if (vrfp) + SET_FLAG(vrfp->status, VRF_CONFIGURED); nb_running_set_entry(args->dnode, vrfp); return NB_OK; From ad70a687884a618d19761e6ac2ee8a3f64bf85d6 Mon Sep 17 00:00:00 2001 From: mugitya03 Date: Sun, 9 Feb 2025 16:07:46 -0500 Subject: [PATCH 3/4] lib: fix a Null Pointer Dereference bug in pullwr.c Signed-off-by: mugitya03 --- lib/pullwr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pullwr.c b/lib/pullwr.c index 919a663db536..41aae0fd6862 100644 --- a/lib/pullwr.c +++ b/lib/pullwr.c @@ -137,7 +137,7 @@ static void pullwr_resize(struct pullwr *pullwr, size_t need) } niov = pullwr_iov(pullwr, iov); - if (niov >= 1) { + if (newbuf && niov >= 1) { memcpy(newbuf, iov[0].iov_base, iov[0].iov_len); if (niov >= 2) memcpy(newbuf + iov[0].iov_len, From e2511de3e380aae5440271b49c71409c1377e823 Mon Sep 17 00:00:00 2001 From: mugitya03 Date: Sun, 9 Feb 2025 16:51:05 -0500 Subject: [PATCH 4/4] lib: fix a Null Pointer Dereference bug in vrf.c Signed-off-by: mugitya03 --- lib/vrf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/vrf.c b/lib/vrf.c index a921a2939ed2..452b44d5b3ca 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -944,7 +944,6 @@ static int lib_vrf_create(struct nb_cb_create_args *args) return NB_OK; vrfp = vrf_get(VRF_UNKNOWN, vrfname); - if (vrfp) SET_FLAG(vrfp->status, VRF_CONFIGURED); nb_running_set_entry(args->dnode, vrfp);