From 86007a74d823a4198475e7ecae4a0845a1cac541 Mon Sep 17 00:00:00 2001 From: Kharec Date: Sun, 28 Dec 2025 08:48:24 +0100 Subject: [PATCH] fix: guard validation helpers against undef host --- lib/Urupam/Utils.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Urupam/Utils.pm b/lib/Urupam/Utils.pm index 4cb4fca..e36dfec 100644 --- a/lib/Urupam/Utils.pm +++ b/lib/Urupam/Utils.pm @@ -58,6 +58,7 @@ sub sanitize_url { return undef if $authority =~ /[\s\x00-\x1F\x7F]/; my $hostport = ( split /\@/, $authority )[-1]; + return undef unless defined $hostport && length $hostport; my $host_raw; if ( $hostport =~ /^\[(.+)\](?::\d+)?$/ ) { $host_raw = $1;