From f71fad50fc4d10caaf156c37610f78f5edf3a255 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 2 Jun 2022 15:48:12 +0800 Subject: [PATCH] Fix potential NULL pointer dereference on NS * src/nsterm.m (ns_mouse_position): Don't test f's tooltip-ness if it's NULL. --- src/nsterm.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index 9a23efe3ac1..b7b7bc2ad34 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2365,7 +2365,7 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, if (!FRAME_NS_P (f)) f = NULL; - if (FRAME_TOOLTIP_P (f)) + if (f && FRAME_TOOLTIP_P (f)) f = dpyinfo->last_mouse_frame; /* While dropping, use the last mouse frame only if there is no -- 2.39.2