Bug#849298: libconfig-inifiles-perl: Infinite loop when "each" is used

Johannes Schauer josch at debian.org
Sat Dec 24 23:24:45 UTC 2016


Package: libconfig-inifiles-perl
Version: 2.94-1
Severity: normal

Hi,

suppose the following code which seems normal for processing the module
as a tied hash:

use Config::IniFiles;
tie (my %ini, 'Config::IniFiles', -file=>"test.ini");
foreach my $s (keys %ini) {
    while (my ($k,$v) = each %{$ini{$s}}) {
        print("$s $k $v\n");
    }
}

Try it on the following trivial config file:

[foo]
bar=baz

The result will be an infinite loop printing "foo bar baz".

This is especially frustrating, because the docs list explicitly that a
statement like the following should work:

while (($k, $v) = each %{$ini{$section}}) {...}

Thanks!

cheers, josch



More information about the pkg-perl-maintainers mailing list