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 'doc%252525252525252525253fid%252525252525252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a%2525252525252525253fid%2525252525252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a%25252525252525253fid%25252525252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a%252525252525253fid%252525252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a&id2%252525252525253d095576b945abee99ad4bcbd9f2e35f3137c22304%2525252525253fid%2525252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a&id2%2525252525253d095576b945abee99ad4bcbd9f2e35f3137c22304%25252525253fid%25252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a%252525253fid%252525253d0d74c14fd19adcf87103b1fc8815c1901ea9f67a%2525253fid%2525253d095576b945abee99ad4bcbd9f2e35f3137c22304%25253fid%25253d39d30073180aeed73ce26ca2a20be19d643e3160%253fid%253d39d30073180aeed73ce26ca2a20be19d643e3160&id2%253d9ef5fe2191c5d1d857bc4fe828c15268ba8caa90%3fid%3d39d30073180aeed73ce26ca2a20be19d643e3160&id2%3d9ef5fe2191c5d1d857bc4fe828c15268ba8caa90?id=39d30073180aeed73ce26ca2a20be19d643e3160')
0 files changed, 0 insertions, 0 deletions