This was always an "issue", but with Perl 5.28, from our Debian Buster
based release, decode_json just ignored the \0 NUL byte.
For example:
```
perl -w -MJSON -e 'my $raw = "[]\0"; print to_json(decode_json($raw), {pretty=>1});'
```
will get you the following error on perl 5.32
```
garbage after JSON object, at character offset 2 (before "\x{0}") at -e line 1.
```
Note, I did not find anything related in the perldelta aricles for
the 28 -> 30 or 30 -> 32 update, the first one made a bigger jump for
the JSON module version used, so possibly a change there.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
if (!$cache || !$ver || !$cache->{version} || ($cache->{version} != $ver)) {
my $tasks = [];
if (my $raw = $ipcc_get_status->("tasklist", $node)) {
- $tasks = decode_json($raw);
+ my $json_str = unpack("Z*", $raw);
+ $tasks = decode_json($json_str);
}
push @$res, @$tasks;
$tasklistcache->{$node} = {