From aaa319735b9bef51d4f91c13c1bca766c0db968e Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sat, 13 Oct 2018 18:08:59 -0300 Subject: Fix UB (dangling pointer usage) Using dangling pointers, even if it's just to compare them with valid pointers (such as comparing them with the ones in sess_list), is UB. This fixes that. --- src/common/hexchat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/hexchat.c') diff --git a/src/common/hexchat.c b/src/common/hexchat.c index e9a9a7fc..347cf1ce 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -191,7 +191,7 @@ lastact_getfirst(int (*filter) (session *sess)) int is_session (session * sess) { - return g_slist_find (sess_list, sess) ? 1 : 0; + return sess != NULL && (g_slist_find (sess_list, sess) ? 1 : 0); } session * -- cgit 1.4.1