getting undefined values with 0.7.0 revision 267.

76 views
Skip to first unread message

Russell Fulton

unread,
Aug 18, 2013, 11:41:14 PM8/18/13
to pulledpo...@googlegroups.com
HI

I have just upgraded to 0.7.0 and I am getting some undefined variable errors in flowbits_set:

Use of uninitialized value in pattern match (m//) at bin/pulledpork.pl line 1213.
Use of uninitialized value in pattern match (m//) at bin/pulledpork.pl line 1213.
Use of uninitialized value in pattern match (m//) at bin/pulledpork.pl line 1213.
......

and in changelog

Use of uninitialized value $msg_holder in pattern match (m//) at bin/pulledpork.pl line 1267.
Use of uninitialized value $msg_holder in pattern match (m//) at bin/pulledpork.pl line 1267.
Use of uninitialized value $msg_holder in pattern match (m//) at bin/pulledpork.pl line 1267.
.....

Use of uninitialized value $msg_holder in pattern match (m//) at bin/pulledpork.pl line 1296.
Use of uninitialized value $msg_holder in pattern match (m//) at bin/pulledpork.pl line 1296.
Use of uninitialized value $msg_holder in pattern match (m//) at bin/pulledpork.pl line 1296.


All of these occur in loops over the rule hash where {'rule'} is undefined.

I think such entries arise if you reference rules in the *.conf files that no longer exist.

One of these seems to be a bug ( line 1267)

        foreach my $k2 ( keys %{ $$hashref{$k1} } ) {
            next if ( ($enonly) && ( $$hashref{$k1}{$k2}{'rule'} =~ /^\s*#/ ) );
            if ( !defined $$hashref2{$k1}{$k2}{'rule'} ) {
                my $msg_holder = $$hashref{$k1}{$k2}{'rule'};

Code check to see if rule is defined and if it *isn't* then references it.

Removing the ! seems to fix this.

The other two instances I added 

            next unless defined $$href{$k1}{$k2}{'rule'} ;                                                                                                                                                     

before trying to reference it.  This seems to do the right thing.

Russell

JJC

unread,
Aug 22, 2013, 10:27:19 AM8/22/13
to pulledpo...@googlegroups.com
This may also be related to a bug where some of the href deref calls are using a newer syntax that some older perl versions don't understand
Reply all
Reply to author
Forward
0 new messages