aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-10-01 14:44:39 +0000
committerThierry Vignaud <tv@mandriva.org>2009-10-01 14:44:39 +0000
commita8e0d6c1f4ce27a47a588034bb372413a2491acc (patch)
tree75864971baa00494ebd6ac62c37e8caedb97ba99 /Rpmdrake
parent7a5a4d4356942739a74b69253b08f31de3147a1f (diff)
downloadrpmdrake-a8e0d6c1f4ce27a47a588034bb372413a2491acc.tar
rpmdrake-a8e0d6c1f4ce27a47a588034bb372413a2491acc.tar.gz
rpmdrake-a8e0d6c1f4ce27a47a588034bb372413a2491acc.tar.bz2
rpmdrake-a8e0d6c1f4ce27a47a588034bb372413a2491acc.tar.xz
rpmdrake-a8e0d6c1f4ce27a47a588034bb372413a2491acc.zip
(pkg2medium) pkg2medium() could return undef but several places
blindly dereferenced it which could lead to rare crashes (#49901)
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/formatting.pm2
-rw-r--r--Rpmdrake/gui.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/Rpmdrake/formatting.pm b/Rpmdrake/formatting.pm
index 8c2f7f0c..6e4e0dc7 100644
--- a/Rpmdrake/formatting.pm
+++ b/Rpmdrake/formatting.pm
@@ -100,7 +100,7 @@ sub pkg2medium {
my ($p, $urpm) = @_;
return if !ref $p;
return { name => N("None (installed)") } if !defined($p->id); # if installed
- URPM::pkg2media($urpm->{media}, $p) || undef;
+ URPM::pkg2media($urpm->{media}, $p) || { name => N("Unknown"), fake => 1 };
}
# [ duplicate urpmi's urpm::msg::localtime2changelog() ]
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 05240dd1..79639485 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -138,7 +138,7 @@ sub format_pkg_simplifiedinfo {
my $upkg = $pkg->{pkg};
return if !$upkg;
my $raw_medium = pkg2medium($upkg, $urpm);
- my $medium = $raw_medium ? $raw_medium->{name} : undef;
+ my $medium = !$raw_medium->{fake} ? $raw_medium->{name} : undef;
my $update_descr = $descriptions->{$medium}{$name};
# discard update fields if not matching:
my $is_update = ($upkg->flag_upgrade && $update_descr && $update_descr->{pre});