FreeBSD Bugzilla – Attachment 231295 Details for
Bug 261455
Fix a possible Null pointer dereference in svc_dg_create()
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-svc_dg_cr.patch (text/plain), 1.00 KB, created by
Zhou Qingyang
on 2022-01-25 05:16:22 UTC
(
hide
)
Description:
A simple fix for this bug
Filename:
MIME Type:
Creator:
Zhou Qingyang
Created:
2022-01-25 05:16:22 UTC
Size:
1.00 KB
patch
obsolete
>From 1a1465a99501e389090c3e8128d8a8c9e81c3c0f Mon Sep 17 00:00:00 2001 >From: Zhou Qingyang <zhou1615@umn.edu> >Date: Tue, 25 Jan 2022 13:12:32 +0800 >Subject: [PATCH] Fix a possible Null pointer dereference in svc_dg_create() > >In sys/rpc/svc_dg.c file, the return value of svc_xprt_alloc() is assigned to >xprt and there is a dereference of it right after that, which would lead to >NULL pointer dereference on failure of allocation. > >Fix this bug by adding a NULL check of xprt. > >This bug is found by static analyzer, please advise. > >Signed-off-by: Zhou Qingyang <zhou1615@umn.edu> >--- > sys/rpc/svc_dg.c | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c >index db192865561..72da9ce68fa 100644 >--- a/sys/rpc/svc_dg.c >+++ b/sys/rpc/svc_dg.c >@@ -119,6 +119,8 @@ svc_dg_create(SVCPOOL *pool, struct socket *so, size_t sendsize, > } > > xprt = svc_xprt_alloc(); >+ if (!xprt) >+ return (NULL); > sx_init(&xprt->xp_lock, "xprt->xp_lock"); > xprt->xp_pool = pool; > xprt->xp_socket = so; >-- >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 261455
: 231295