You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We found function ls_vertex_add can return NULL value when key is invalid or XCALLOC fails.
/* Check that key is valid */if (key==0)
returnNULL;
/* Create Vertex and add it to the TED */new=XCALLOC(MTYPE_LS_DB, sizeof(structls_vertex));
if (!new)
returnNULL;
However, some caller functions don't check the return value of ls_vertex_add before dereferencing, causing potential null pointer dereference bugs.
We found that some call functions already perform a null value check on the return value before dereferencing (link, link). Therefore, we believe the above call sites also need to add such checks.
Version
latest master
How to reproduce
When key is invalid or XCALLOC fails, the function ls_vertex_add can return NULL value.
Expected behavior
No
Actual behavior
No
Additional context
No response
Checklist
I have searched the open issues for this bug.
I have not included sensitive information in this report.
The text was updated successfully, but these errors were encountered:
@ton31337 Could you please take a look at these issues? They appear to be similar to 18072 due to missing null value checks, but I'm unsure of the best way to fix them.
Description
Dear Developers,
We found function
ls_vertex_add
can return NULL value whenkey
is invalid orXCALLOC
fails.However, some caller functions don't check the return value of
ls_vertex_add
before dereferencing, causing potential null pointer dereference bugs.vertex = ls_vertex_add(ted, node);
linkvertex = ls_vertex_add(ted, node);
linkvertex = ls_vertex_add(ted, old);
linkvertex = ls_vertex_add(ted, lnode);
linkWe found that some call functions already perform a null value check on the return value before dereferencing (link, link). Therefore, we believe the above call sites also need to add such checks.
Version
How to reproduce
When
key
is invalid orXCALLOC
fails, the functionls_vertex_add
can return NULL value.Expected behavior
No
Actual behavior
No
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: