Fix CGI::param error in collection3
authorKentaro Hayashi <kenhys@xdump.org>
Wed, 14 Jul 2021 12:46:02 +0000 (13:46 +0100)
committerKentaro Hayashi <kenhys@xdump.org>
Wed, 14 Jul 2021 12:46:02 +0000 (13:46 +0100)
commita3d9e7291aff6636f3a9c7279d1132a75ab193b8
tree95380c1ba740640e8154aa4b57ee22da4ea32e7b
parent998de421b5af2f78dedcd1f74cb541661d649212
Fix CGI::param error in collection3

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982294
Forwarded: https://salsa.debian.org/debian/pkg-collectd/-/merge_requests/6

When using collection3 as a CGI, the following error is sent to logs repeatedly.
This MR fixes it:

  FastCGI sent in stderr: "CGI::param called in list context from /usr/share/doc/collectd-core/examples/collection3/lib/Collectd/Graph/Common.pm line 529, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 412"

This is caused by inappropriate usage of param(),
it should be handled as a scalar or should be treated by multi_param() explicitly.

Closes: #982294
ref. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982294

Gbp-Pq: Name cgi-param-in-list-context.patch
contrib/collection3/lib/Collectd/Graph/Common.pm