diff options
Prevent segfault when all todo items are hidden
To prevent from illegal memory access, we checked whether the list of
todo items is empty before performing an interactive todo item action
such as flagging or removal. However, since 1a4bf2b (Add a "hide
completed" view to the todo panel, 2016-01-17), it is possible to hide
completed items from the todo panel. Thus, it may occur that the todo
list box is empty while the list of todo items is not.
To detect such situations as well, teach todo_get_item() to return NULL
if the requested item does not exist. Then, instead of checking whether
the todo item list is non-empty, make sure that the item returned by
todo_get_item() is non-NULL when performing an action.
Reported-by: Vlad Glagolev <scm@vaygr.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to '%2525252525252525253fid%2525252525252525253d095576b945abee99ad4bcbd9f2e35f3137c22304&id2%2525252525252525253d39d30073180aeed73ce26ca2a20be19d643e3160%25252525252525253fid%25252525252525253d095576b945abee99ad4bcbd9f2e35f3137c22304%252525252525253fid%252525252525253d095576b945abee99ad4bcbd9f2e35f3137c22304%2525252525253fid%2525252525253d095576b945abee99ad4bcbd9f2e35f3137c22304%25252525253fid%25252525253d095576b945abee99ad4bcbd9f2e35f3137c22304&id2%25252525253d39d30073180aeed73ce26ca2a20be19d643e3160%252525253fid%252525253d095576b945abee99ad4bcbd9f2e35f3137c22304&id2%252525253d39d30073180aeed73ce26ca2a20be19d643e3160%2525253fid%2525253d095576b945abee99ad4bcbd9f2e35f3137c22304&id2%2525253d39d30073180aeed73ce26ca2a20be19d643e3160%25253fid%25253d095576b945abee99ad4bcbd9f2e35f3137c22304%253fid%253d095576b945abee99ad4bcbd9f2e35f3137c22304%3fid%3d095576b945abee99ad4bcbd9f2e35f3137c22304?id=39d30073180aeed73ce26ca2a20be19d643e3160')
0 files changed, 0 insertions, 0 deletions