Bug 261455

Summary: Fix a possible Null pointer dereference in svc_dg_create()
Product: Base System Reporter: Zhou Qingyang <zhou1615>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Not A Bug    
Severity: Affects Many People CC: kib
Priority: ---    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
A simple fix for this bug none

Description Zhou Qingyang 2022-01-25 05:16:22 UTC
Created attachment 231295 [details]
A simple fix for this bug

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.
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2022-01-27 02:37:59 UTC
See explanation in PR #261454.