From 1f6e6c800cac0b53aa97d0b3d6cd08e381ed6658 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Thu, 1 Sep 2016 18:19:53 +0200 Subject: sboinstall: guard template decoding with eval --- sboinstall | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sboinstall b/sboinstall index a0734b5..6cb2d0d 100755 --- a/sboinstall +++ b/sboinstall @@ -102,9 +102,11 @@ if (length $utemp) { $non_int = 1; my $data = slurp($utemp); - do { warn "Could not read template from $utemp.\n"; exit _ERR_OPENFH } if not length $data; + if (length $data) { + eval { $template = $json->decode($data); }; + } + do { warn "Could not read template from $utemp.\n"; exit _ERR_OPENFH } if not defined $template; - $template = $json->decode($data); $build_queue = $template->{build_queue}; } else { if ($no_reqs or $non_int) { -- cgit v1.2.3