From 59a30d880b5af0be7c478123163e819e3b9d1f5f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 20 Oct 2021 16:33:39 +0300 Subject: Fixed a potential crash Be more robust in `init_Url()`. --- src/gmutil.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gmutil.c b/src/gmutil.c index e44971d0..264e7ac8 100644 --- a/src/gmutil.c +++ b/src/gmutil.c @@ -35,6 +35,10 @@ iRegExp *newGemtextLink_RegExp(void) { } void init_Url(iUrl *d, const iString *text) { + if (!text) { + iZap(*d); + return; + } /* Handle "file:" as a special case since it only has the path part. */ if (startsWithCase_String(text, "file://")) { iZap(*d); -- cgit v1.2.3