From b25b4576e3fd889b3edadb51ff9a387ef0bae653 Mon Sep 17 00:00:00 2001 From: Leon Henrik Plickat Date: Tue, 22 Sep 2020 13:39:03 +0200 Subject: [PATCH] Correctly abort when launched with invalid URL The return value of set_url() was not checked, meaning that when it failed, gmnlm continued anyway, causing an assertion to fail and subsequentially resulting in a segfault. --- src/gmnlm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gmnlm.c b/src/gmnlm.c index 756520c..02d8829 100644 --- a/src/gmnlm.c +++ b/src/gmnlm.c @@ -797,7 +797,9 @@ main(int argc, char *argv[]) } if (optind == argc - 1) { - set_url(&browser, argv[optind], &browser.history); + if (!set_url(&browser, argv[optind], &browser.history)) { + return 1; + } } else { usage(argv[0]); return 1;