Browse code

dlgs: safety check for accessing next field

(cherry picked from commit 7dd643a88fd7944ee86b795298c76e6d5fd58b8f)

Daniel-Constantin Mierla authored on 08/04/2021 07:36:49
Showing 1 changed files
... ...
@@ -970,7 +970,9 @@ void dlgs_ht_timer(unsigned int ticks, void *param)
970 970
 						it->prev = NULL;
971 971
 					}
972 972
 				} else {
973
-					ite->prev->next = it;
973
+					if(ite->prev) {
974
+						ite->prev->next = it;
975
+					}
974 976
 					if(it!=NULL) {
975 977
 						it->prev = ite->prev;
976 978
 					}