aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-17 11:36:49 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-18 00:42:32 +0100
commit0ca64b6236f8fe767181214a97d8428d473b8e32 (patch)
treede66fd805b50e782b5a84c98370d1e60119a9ad6
parentbddbc17b87f3de29657f1dd2b9a065901e955c15 (diff)
client: avoid "Use of uninitialized value in pattern match (m//)" perl warnings.
When the accountd socket can't be reached.
-rw-r--r--Changelog2
-rwxr-xr-xclient7
2 files changed, 7 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 51f9728..ac8102c 100644
--- a/Changelog
+++ b/Changelog
@@ -42,6 +42,8 @@ lacme (0.7.1) upstream;
- client: fail immediately when the accountd is unreachable.
- Makefile: set executable bit for $(bindir)/lacme-accountd and
$(sbindir)/lacme.
+ - client: avoid "Use of uninitialized value in pattern match (m//)"
+ perl warnings when the accountd socket can't be reached.
-- Guilhem Moulin <guilhem@fripost.org> Wed, 09 Dec 2020 18:23:22 +0100
diff --git a/client b/client
index bcdf6cd..e29d2a0 100755
--- a/client
+++ b/client
@@ -75,8 +75,11 @@ open (my $S, '+<&=', $1+0) or die "fdopen $1: $!";
# Read the protocol version and JSON Web Key (RFC 7517) from the
# lacme-accountd socket
#
-die "Error: Invalid client version\n" unless
- $S->getline() =~ /\A(\d+) OK(?:.*)\r\n\z/ and $1 == $PROTOCOL_VERSION;
+do {
+ my $greeting = $S->getline();
+ die "Error: Invalid client version\n" unless defined $greeting and
+ $greeting =~ /\A(\d+) OK(?:.*)\r\n\z/ and $1 == $PROTOCOL_VERSION;
+};
my $JWK = JSON::->new->decode($S->getline());
my $KID;