From 7d99da77cc179bd1b1fbd21423771be1e57e3b56 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 25 Jun 2024 22:22:02 -0400 Subject: [PATCH] header_ok: Fail if the reply is falsy --- ddclient.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ddclient.in b/ddclient.in index df3c168..877d8a3 100755 --- a/ddclient.in +++ b/ddclient.in @@ -3791,6 +3791,10 @@ sub nic_updateable { ###################################################################### sub header_ok { my ($host, $line) = @_; + if (!$line) { + failed("updating %s: no response from server", $host); + return 0; + } $line =~ s/\r?\n.*//s; my ($code, $msg) = ($line =~ qr%^\s*HTTP/.*\s+(\d+)\s*(?:\s+([^\s].*))?$%i); if (!defined($code)) {