summaryrefslogtreecommitdiffstats
path: root/perl-install/c/stuff.xs.pl
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-15 06:03:35 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-15 06:03:35 +0000
commite410e3e217d8b6ff675421361b834567b9c13309 (patch)
tree0fdfbb510520f3fca071b9be8d445493bb97aedf /perl-install/c/stuff.xs.pl
parentdef745743bbd2e52dd955e2fd86b48003c32293f (diff)
downloaddrakx-e410e3e217d8b6ff675421361b834567b9c13309.tar
drakx-e410e3e217d8b6ff675421361b834567b9c13309.tar.gz
drakx-e410e3e217d8b6ff675421361b834567b9c13309.tar.bz2
drakx-e410e3e217d8b6ff675421361b834567b9c13309.tar.xz
drakx-e410e3e217d8b6ff675421361b834567b9c13309.zip
(get_iso_volume_ids) disk install: handle bogus ISOs when looking for install image (mga#4919)
Diffstat (limited to 'perl-install/c/stuff.xs.pl')
-rwxr-xr-xperl-install/c/stuff.xs.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index 9316db519..d36001baf 100755
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -549,8 +549,10 @@ get_iso_volume_ids(int fd)
lseek(fd, 16 * ISOFS_BLOCK_SIZE, SEEK_SET);
if (read(fd, &voldesc, sizeof(struct iso_primary_descriptor)) == sizeof(struct iso_primary_descriptor)) {
if (voldesc.type[0] == ISO_VD_PRIMARY && !strncmp(voldesc.id, ISO_STANDARD_ID, sizeof(voldesc.id))) {
- XPUSHs(sv_2mortal(newSVpv(voldesc.volume_id, length_of_space_padded(voldesc.volume_id, sizeof(voldesc.volume_id)))));
- XPUSHs(sv_2mortal(newSVpv(voldesc.application_id, length_of_space_padded(voldesc.application_id, sizeof(voldesc.application_id)))));
+ size_t vol_id_len = length_of_space_padded(voldesc.volume_id, sizeof(voldesc.volume_id));
+ size_t app_id_len = length_of_space_padded(voldesc.application_id, sizeof(voldesc.application_id));
+ XPUSHs(vol_id_len != -1 ? sv_2mortal(newSVpv(voldesc.volume_id, vol_id_len)) : newSVpvs(""));
+ XPUSHs(app_id_len != -1 ? sv_2mortal(newSVpv(voldesc.application_id, app_id_len)) : newSVpvs(""));
}
}