libsemanage: semanage_list_sort: handle a NULL *l correctly
Stephen Smalley
maintainerPATCH 1/1 libsemanage: semanage_list_sort: handle a NULL *l correctly
No existing caller passes semanage_list_sort() a NULL *l but we might as well check for future-proofing.
Signed-off-by Stephen Smalley <[email protected]>
--- libsemanage/src/utilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libsemanage/src/utilities.c +1 -1
@@ -167,7 +167,7 @@ int semanage_list_sort(semanage_list_t **l)size_t count =0 ;size_t i =0 ; -if (!l || !(*l)->next) +if (!l || !*l || !(*l)->next)return 0 ;for (temp = *l; temp; temp = temp->next)
Signature · 1 line
2.55.0
Stephen Smalley
maintainerQuoted 5 lines · Stephen Smalley
No existing caller passes
semanage_list_sort()a NULL *l but we might as well check for future-proofing.Signed-off-by Stephen Smalley <[email protected]>
This has been merged.