From d34f94a1cccea9b9ddf5beef9cbdfa6e5be055f4 Mon Sep 17 00:00:00 2001 From: dpopov76 Date: Tue, 29 Oct 2024 04:30:08 -0700 Subject: [PATCH] fix(table): fixed NULL pointer reference (#7042) --- src/widgets/table/lv_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/table/lv_table.c b/src/widgets/table/lv_table.c index affb99b88..444406040 100644 --- a/src/widgets/table/lv_table.c +++ b/src/widgets/table/lv_table.c @@ -277,7 +277,7 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt) int32_t i; for(i = 0; i < (int32_t)old_col_cnt - (int32_t)col_cnt; i++) { uint32_t idx = old_col_start + min_col_cnt + i; - if(table->cell_data[idx]->user_data) { + if(table->cell_data[idx] && table->cell_data[idx]->user_data) { lv_free(table->cell_data[idx]->user_data); table->cell_data[idx]->user_data = NULL; }