summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2015-09-11 13:20:22 +0200
committeranonym <anonym@riseup.net>2015-09-11 13:20:22 +0200
commit95de82a5848f5a4c83632e85bc74f805d9bf9161 (patch)
treee936ce1b2c64e842be5055f4dc72644f4794b0f2
parentd133a9b924ef7e4c7c4b04a9dd93d6bf67e7eecf (diff)
Avoid use of uninitialized value in restricted-network-detector.
If NetworkManager decides that a wireless connection has timed out before "supplicant connection state" has occued, our idea of the state is `undef`, so it cannot be used in a string comparison. Hence, let's initialize the state to the empty string instead of `undef`. Will-fix: #7689
-rwxr-xr-xconfig/chroot_local-includes/usr/local/sbin/tails-restricted-network-detector2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/chroot_local-includes/usr/local/sbin/tails-restricted-network-detector b/config/chroot_local-includes/usr/local/sbin/tails-restricted-network-detector
index 9dc0f18..443216d 100755
--- a/config/chroot_local-includes/usr/local/sbin/tails-restricted-network-detector
+++ b/config/chroot_local-includes/usr/local/sbin/tails-restricted-network-detector
@@ -61,7 +61,7 @@ while(my $sl = $parser->next) {
# The beginning of *all* (not only wireless) new
# connections. We drop any previous state so it won't
# interfere.
- $state{$1} = undef;
+ $state{$1} = "";
} elsif ($text =~ /\(([^)]+)\): supplicant connection state:.*-> (.*)$/) {
# Wireless connection state transition.
$state{$1} = $2;