Skip to content
Commit 4a18d615 authored by Piotr Pryga's avatar Piotr Pryga Committed by Marti Bolivar
Browse files

slist: Fix sys_slist_append_list with head and tail NULL break a list



If the sys_slist_t instance is not empty, its head and tail points to
some sys_snode_t instances. If sys_slist_append_list is executed with
tail being NULL the list object is corrupted. Tail of the sys_slist_t
instance is set to NULL. If one executes sys_slist_append on that node,
then nodes pointed by head are lost.

The commit fixes the issue and adds unit tests to verify correct
behavior.

Added change verifies if head and tail of appended list are not NULL.
In other case the list object is invalid and should not be appended
to a valid list instance.

Signed-off-by: default avatarPiotr Pryga <piotr.pryga@nordicsemi.no>
parent 7b43deed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment