From 1da2344aa3c88486dc11eeae2bd8583827e01f7f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Jun 2021 13:03:47 +0530 Subject: [PATCH] Fix a possible crash when handling mouse clicks --- kitty/screen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kitty/screen.c b/kitty/screen.c index d05cc4246..5d5a81540 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -2167,6 +2167,7 @@ screen_detect_url(Screen *screen, unsigned int x, unsigned int y) { bool has_url = false; index_type url_start, url_end = 0; Line *line = screen_visual_line(screen, y); + if (!line || x >= screen->columns) return false; if (line->cpu_cells[x].hyperlink_id) { screen_mark_hyperlink(screen, x, y); return true;