From 84c3e994c70aebb5ed1882a1f9cb2bfa6f64d39d Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 21:30:14 +0100 Subject: [PATCH] perl: Check for NULL before dereferencing CID #38023 Signed-off-by: Florian Forster --- src/perl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/perl.c b/src/perl.c index 5aa96c35..67cb842b 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1643,15 +1643,15 @@ static XS (Collectd_plugin_dispatch_values) values = ST (/* stack index = */ 0); + if (NULL == values) + XSRETURN_EMPTY; + /* Make sure the argument is a hash reference. */ if (! (SvROK (values) && (SVt_PVHV == SvTYPE (SvRV (values))))) { log_err ("Collectd::plugin_dispatch_values: Invalid values."); XSRETURN_EMPTY; } - if (NULL == values) - XSRETURN_EMPTY; - ret = pplugin_dispatch_values (aTHX_ (HV *)SvRV (values)); if (0 == ret) -- 2.11.0