summary refs log tree commit diff stats
path: root/src/common/hexchat.c
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2018-10-13 18:08:59 -0300
committerSoniEx2 <endermoneymod@gmail.com>2018-10-13 18:10:24 -0300
commitaaa319735b9bef51d4f91c13c1bca766c0db968e (patch)
tree5d21b1e9597e1d94ea19c726b561a173872606da /src/common/hexchat.c
parent643269445530edd0ee6a308f771767ec3f9a1919 (diff)
Fix UB (dangling pointer usage) fix-ub
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.
Diffstat (limited to 'src/common/hexchat.c')
-rw-r--r--src/common/hexchat.c2
1 files changed, 1 insertions, 1 deletions
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 *