From a1656f702b2ed3a07ca3c189a895a393611791bc Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 21 Jun 2008 16:46:41 +0000 Subject: [PATCH] In check_status_code_result(), make sure $status_code is defined before checking it. --- tools/privoxy-regression-test.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl index 21f0e215..ea9d78ca 100755 --- a/tools/privoxy-regression-test.pl +++ b/tools/privoxy-regression-test.pl @@ -7,7 +7,7 @@ # A regression test "framework" for Privoxy. For documentation see: # perldoc privoxy-regression-test.pl # -# $Id: privoxy-regression-test.pl,v 1.153 2008/05/25 18:48:07 fk Exp $ +# $Id: privoxy-regression-test.pl,v 1.154 2008/06/21 16:44:09 fk Exp $ # # Wish list: # @@ -741,7 +741,13 @@ sub check_status_code_result ($$) { my $expected_status_code = shift; my $result = 0; - if ($expected_status_code == $status_code) { + unless (defined $status_code) { + + # XXX: should probably be caught earlier. + l(LL_VERBOSE_FAILURE, + "Ooops. We expected status code " . $expected_status_code . ", but didn't get any status code at all."); + + } elsif ($expected_status_code == $status_code) { $result = 1; l(LL_VERBOSE_SUCCESS, -- 2.39.2