chiark / gitweb /
blinding: Fix (again) move of Params setting into check_divert
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 27 Oct 2015 18:49:04 +0000 (18:49 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 27 Oct 2015 18:49:27 +0000 (18:49 +0000)
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 <Ian.Jackson@eu.citrix.com>
cgi-auth-flexible.pm

index 79e12d3..a297519 100644 (file)
@@ -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))
            ];