mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-13 12:33:27 +02:00
util/llsort: Prevent NULL pointer dereference
If `_tail` is not assigned, we cannot assign `_tail->next`. Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This commit is contained in:
parent
1c11d4fa25
commit
2bb37f846e
1 changed files with 2 additions and 1 deletions
3
external/util/include/util/llsort.h
vendored
3
external/util/include/util/llsort.h
vendored
|
|
@ -121,7 +121,8 @@
|
|||
* and q has too */ \
|
||||
_p = _q; \
|
||||
} \
|
||||
_tail->next = NULL; \
|
||||
if (_tail) \
|
||||
_tail->next = NULL; \
|
||||
/* If we have done only one merge, we're finished. */ \
|
||||
if (_nmerges <= 1) { \
|
||||
/* allow for nmerges == 0, the empty list case */ \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue