Fix out-of-bounds memory access

Do not try to access freed day items. This also fixes unexpected
selection changes after modifying appointments or events.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-09-27 18:52:13 +02:00
parent 77d5b10ee0
commit ab9256adf0
4 changed files with 26 additions and 5 deletions

View File

@@ -772,6 +772,7 @@ int day_check_if_item(struct date);
unsigned day_chk_busy_slices(struct date, int, int *);
struct day_item *day_cut_item(long, int);
int day_paste_item(struct day_item *, long);
int day_get_position_by_aptev_ptr(union aptev_ptr);
int day_get_position(struct day_item *);
struct day_item *day_get_item(int);
unsigned day_item_count(int);
@@ -1044,6 +1045,7 @@ void todo_free_list(void);
/* ui-day.c */
struct day_item *ui_day_selitem(void);
void ui_day_set_selitem_by_aptev_ptr(union aptev_ptr);
void ui_day_set_selitem(struct day_item *);
void ui_day_item_add(void);
void ui_day_item_delete(unsigned);