cnss2: Fix potential null dereference and buffer overrun
plat_priv is dereferenced before NULL check.
Thus fix it by first doing the NULL check and then dereference.
In bypass_bdf path, temp is set to DUMMY_BDF_FILE_NAME and
remaining is set to MAX_FIRMWARE_NAME_LEN. Since
MAX_FIRMWARE_NAME_LEN is larger than length of temp buffer,
memcpy will lead to a out-of-bounds access. Thus fix it
by properly setting remaining.
Change-Id: I650bb743f3d603dec43ae1e291226af67477357f
Signed-off-by:
Jia Ding <jiad@codeaurora.org>
Loading
Please register or sign in to comment