(needs review)

Resolved problem with warnings
Use of uninitialized value within %map2name in hash element at /usr/local/share/perl/5.14.2/Crypt/PWSafe3/Record.pm line 140.
occuring on true PasswordSafe file.

I am not sure whether this could cause some data to be dropped, but the fix seems consistent with the other code.
This commit is contained in:
Marcin Kasperski
2012-11-18 00:38:10 +01:00
parent 9b0a3db439
commit aacfeeb474

View File

@@ -137,7 +137,11 @@ sub addfield {
#
# add a field to the record
my ($this, $field) = @_;
$this->{field}->{ $map2name{$field->type} } = $field;
my $name = $map2name{$field->type};
unless( defined($name) ) {
$name = $field->type; # consistent with Field->new
}
$this->{field}->{ $name } = $field;
}
=head1 NAME