From eed83717b6125ba655be9ffd618f301ef97948b2 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 12 Nov 2021 06:43:03 +0200 Subject: Fixed crash if "open" command has no "url" IssueID #385 --- src/app.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index 63a286f8..148bba52 100644 --- a/src/app.c +++ b/src/app.c @@ -2626,7 +2626,11 @@ iBool handleCommand_App(const char *cmd) { return iTrue; } else if (equal_Command(cmd, "open")) { - iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url")); + const char *urlArg = suffixPtr_Command(cmd, "url"); + if (!urlArg) { + return iTrue; /* invalid command */ + } + iString *url = collectNewCStr_String(urlArg); const iBool noProxy = argLabel_Command(cmd, "noproxy") != 0; const iBool fromSidebar = argLabel_Command(cmd, "fromsidebar") != 0; iUrl parts; -- cgit v1.2.3