]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1220734 - Use of uninitialized value $proxies[0] in string eq at Bugzilla/Util...
authorDavid Lawrence <dkl@mozilla.com>
Tue, 3 Nov 2015 22:22:31 +0000 (22:22 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Tue, 3 Nov 2015 22:22:31 +0000 (22:22 +0000)
Bugzilla/Util.pm

index 19444082fb69c4c7e450dbc2dd244f5743719ef4..2703a542ee529b34fc7209112868d72bb233a6ee 100644 (file)
@@ -312,7 +312,7 @@ sub remote_ip {
     my @x_forwarded_for = split(/[\s,]+/, $ENV{HTTP_X_FORWARDED_FOR} // '');
 
     return $remote_ip unless @x_forwarded_for;
-    return $x_forwarded_for[0] if $proxies[0] eq '*';
+    return $x_forwarded_for[0] if @proxies && $proxies[0] eq '*';
     return $remote_ip if none { $_ eq $remote_ip } @proxies;
 
     foreach my $ip (reverse @x_forwarded_for) {