From d8f2e2818a90ea2fa2ce60985f613875b5e52f7c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 27 Oct 2015 18:49:04 +0000 Subject: [PATCH] blinding: Fix (again) move of Params setting into check_divert Do not inadvertently autoviviy $divert as an arrayref. If we do then the web app (or check_ok) sees it as trueish and will try diverting with an empty divert spec, rather than seeing it as falseish and correctly proceeding to do the real work. Signed-off-by: Ian Jackson --- cgi-auth-flexible.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index 79e12d3..a297519 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -1030,9 +1030,9 @@ sub check_divert ($) { $dbh->commit(); my $divert = $r->{Divert}; - my $cookraw = $divert->{_CookieRaw}; - $divert->{CookieSecret} = $r->_blind($cookraw); + my $cookraw = $divert && $divert->{_CookieRaw}; if ($cookraw) { + $divert->{CookieSecret} = $r->_blind($cookraw); $divert->{Params}{$r->{S}{assoc_param_name}} = [ $r->_blind($r->hash($cookraw)) ]; -- 2.30.2