Bug 263396 - Fix a possible NULL pointer dereference bug in ocs_hw_setup()
Summary: Fix a possible NULL pointer dereference bug in ocs_hw_setup()
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-18 16:20 UTC by Zhou Qingyang
Modified: 2022-04-18 16:20 UTC (History)
0 users

See Also:


Attachments
A possible fix for this bug (1.19 KB, patch)
2022-04-18 16:20 UTC, Zhou Qingyang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhou Qingyang 2022-04-18 16:20:36 UTC
Created attachment 233305 [details]
A possible fix for this bug

The function ocs_hw_qtop_parse() could return NULL on malloc failure.
However the caller function ocs_hw_setup() of ocs_hw_qtop_parse()
uses the return value without check, which could lead to NULL pointer 
dereference.

Fix this by adding a NULL check.

this patch is a possible fix.