Группа :: Разработка/Perl
Пакет: perl-RPM
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: perl-RPM-0.40-alt-fix-segv.patch
--- Perl-RPM-0.40/t/08_segv.t- 2005-09-07 03:25:26 +0400
+++ Perl-RPM-0.40/t/08_segv.t 2005-09-07 04:05:21 +0400
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+
+use RPM::Header;
+use Test::More tests => 1;
+
+{
+ my $h = RPM::Header->new;
+ ok($$h{VERSION} eq "");
+}
--- Perl-RPM-0.40/RPM/Header.xs- 2005-09-07 03:23:51 +0400
+++ Perl-RPM-0.40/RPM/Header.xs 2005-09-07 03:39:03 +0400
@@ -372,11 +372,11 @@ SV* rpmhdr_FETCH(pTHX_ RPM__Header self,
sv_free(FETCH);
/* Check the three keys that are cached directly on the struct itself: */
- if (! strcmp(uc_name, "NAME"))
+ if (! strcmp(uc_name, "NAME") && hdr->name)
FETCH = newSVpv((char *)hdr->name, 0);
- else if (! strcmp(uc_name, "VERSION"))
+ else if (! strcmp(uc_name, "VERSION") && hdr->version)
FETCH = newSVpv((char *)hdr->version, 0);
- else if (! strcmp(uc_name, "RELEASE"))
+ else if (! strcmp(uc_name, "RELEASE") && hdr->release)
FETCH = newSVpv((char *)hdr->release, 0);
else
{