]> git.proxmox.com Git - pve-cluster.git/commit
get tasklist: unpack null-terminated C string before decoding as JSON
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 15 May 2021 11:00:46 +0000 (13:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 16 May 2021 14:12:35 +0000 (16:12 +0200)
commitaea0f5a66f5bd0c68fcbe733675d66408e2486d7
treeee4499f48d2bb6f0fff8e0788b5fbbe7db6e94c7
parent1f1c5c4309f5b3d37bf3f8587b02d8a2911e1b55
get tasklist: unpack null-terminated C string before decoding as JSON

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>
data/PVE/Cluster.pm