From b2636dcb2911dfc192748e4a20122886b14e4207 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 8 Nov 2017 17:33:13 +0100 Subject: [PATCH] TT#24097 Enable strict and warnings everywhere Change-Id: I7362eaf95a41c67f65d79ea9e4bc1fb94eb32e69 --- tests/kernel-module-test.pl | 12 ++++++++---- utils/rtpengine-ctl | 3 +++ 2 files changed, 11 insertions(+), 4 deletions(-) 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;