From 45476fccb3e529fb4208073221dbf98c0c9d4c1f Mon Sep 17 00:00:00 2001 From: Komari Spaghetti <3759175+Hejsil@users.noreply.github.com> Date: Tue, 3 Aug 2021 16:20:58 +0200 Subject: [PATCH] Fix buffer overflows in openurlonclick.c --- patch/openurlonclick.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patch/openurlonclick.c b/patch/openurlonclick.c index 8a8267c..7b4b82f 100644 --- a/patch/openurlonclick.c +++ b/patch/openurlonclick.c @@ -46,13 +46,14 @@ openUrlOnClick(int col, int row, char* url_opener) col_start = 0; row_start++; } - } while (row_start != row_end || col_start != col_end); + } while (url_index < (sizeof(url)-1) && + (row_start != row_end || col_start != col_end)); if (strncmp("http", url, 4) != 0) { return; } - char command[strlen(url_opener)+1+strlen(url)]; + char command[strlen(url_opener)+strlen(url)+2]; sprintf(command, "%s %s", url_opener, url); system(command); -} \ No newline at end of file +}