mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
NetworkPkg/DxeNetLib: Fix CodeQl Error
Fix possible NULL pointer dereference in NetBuffer.c This was flagged by CodeQl as an error. Github Issue #11190 Signed-off-by: Brit Chesley <brit.chesley@amd.com>
This commit is contained in:
parent
617e061830
commit
e076d2ab8c
2 changed files with 8 additions and 3 deletions
|
|
@ -2081,7 +2081,8 @@ NetbufQueAppend (
|
|||
@param[out] Dest The destination of the data to copy to.
|
||||
|
||||
@return The length of the actual copied data, or 0 if the offset
|
||||
specified exceeds the total size of net buffer queue.
|
||||
specified exceeds the total size of net buffer queue, or
|
||||
a NetBuf pointer is NULL.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
|
|
|
|||
|
|
@ -1430,7 +1430,8 @@ NetbufQueRemove (
|
|||
@param[out] Dest The destination of the data to copy to.
|
||||
|
||||
@return The length of the actual copied data, or 0 if the offset
|
||||
specified exceeds the total size of net buffer queue.
|
||||
specified exceeds the total size of net buffer queue, or
|
||||
a NetBuf pointer is NULL.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
|
|
@ -1476,7 +1477,10 @@ NetbufQueCopy (
|
|||
Cur += Nbuf->TotalSize;
|
||||
}
|
||||
|
||||
ASSERT (Nbuf != NULL);
|
||||
if (Nbuf == NULL) {
|
||||
ASSERT (FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Copy the data in the first buffer.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue