diff --git a/tests/kernel-module-test.pl b/tests/kernel-module-test.pl index ab0ab4ac3..8c38842c7 100755 --- a/tests/kernel-module-test.pl +++ b/tests/kernel-module-test.pl @@ -34,10 +34,14 @@ sub re_address { } sub re_srtp { my ($h) = @_; - no warnings; - return pack('VV a16 a16 a256 Q VV', $ciphers{$$h{cipher}}, $hmacs{$$h{hmac}}, - @$h{qw(master_key master_salt mki last_index auth_tag_len mki_len)}); - use warnings; + my %opts = %{$h}; + + # Explicitly initialize the hash entries. + $opts{$_} //= q{} foreach (qw(master_key master_salt mki)); + $opts{$_} //= 0 foreach (qw(last_index auth_tag_len mki_len)); + + return pack('VV a16 a16 a256 Q VV', $ciphers{$opts{cipher}}, $hmacs{$opts{hmac}}, + @opts{qw(master_key master_salt mki last_index auth_tag_len mki_len)}); } sub rtpengine_message { my ($cmd, %args) = @_; diff --git a/utils/rtpengine-ctl b/utils/rtpengine-ctl index 496d50673..4eccff63f 100755 --- a/utils/rtpengine-ctl +++ b/utils/rtpengine-ctl @@ -1,5 +1,8 @@ #!/usr/bin/perl +use strict; +use warnings; + use IO::Socket::INET; my $num_args = $#ARGV + 1;