FreeBSD Bugzilla – Attachment 231297 Details for
Bug 261457
Fix a possible Null pointer dereference in mld_is_addr_reported()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
A simple fix for this bug
0001-Fix-a-possible-Null-pointer-dereference-in-mld_is_ad.patch (text/plain), 1.04 KB, created by
Zhou Qingyang
on 2022-01-25 07:11:23 UTC
(
hide
)
Description:
A simple fix for this bug
Filename:
MIME Type:
Creator:
Zhou Qingyang
Created:
2022-01-25 07:11:23 UTC
Size:
1.04 KB
patch
obsolete
>From cc8cc5e634a72c4d961497b4abbcbbc1c1700061 Mon Sep 17 00:00:00 2001 >From: Zhou Qingyang <zhou1615@umn.edu> >Date: Tue, 25 Jan 2022 15:09:03 +0800 >Subject: [PATCH] Fix a possible Null pointer dereference in > mld_is_addr_reported() > >In mld_is_addr_reported(), the return value of mli_alloc_locked() is >assigned to mli and there is a dereference of it after that, >which could lead to NULL pointer dereference on failure of allocation. > >Fix this bug by adding a NULL check of mli. > >This bug is found by a static analyzer, please advise. > >Signed-off-by: Zhou Qingyang <zhou1615@umn.edu> >--- > sys/netinet6/mld6.c | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c >index 1f79ef39e40..819a9e8fd7d 100644 >--- a/sys/netinet6/mld6.c >+++ b/sys/netinet6/mld6.c >@@ -481,6 +481,11 @@ mld_domifattach(struct ifnet *ifp) > MLD_LOCK(); > > mli = mli_alloc_locked(ifp); >+ if (!mli) { >+ MLD_UNLOCK(); >+ return (NULL); >+ } >+ > if (!(ifp->if_flags & IFF_MULTICAST)) > mli->mli_flags |= MLIF_SILENT; > if (mld_use_allow) >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 261457
: 231297