Bug fix: -boot_image "any" "system_area=/dev/zero" did not zeroize loaded data

This commit is contained in:
Thomas Schmitt 2015-12-23 11:18:38 +00:00
parent 0365cffbc5
commit a270ad22f9
7 changed files with 13 additions and 2 deletions

View File

@ -274,6 +274,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->boot_efi_default= 0;
m->system_area_disk_path[0]= 0;
m->system_area_clear_loaded= 0;
m->system_area_options= 0;
m->patch_system_area= 0;
m->partition_offset= 0;

View File

@ -471,6 +471,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
Xorriso_destroy_hln_array(xorriso, 0);
Xorriso_destroy_di_array(xorriso, 0);
xorriso->boot_count= 0;
xorriso->system_area_clear_loaded=
(strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0);
/* check for invalid state */
if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE &&

View File

@ -113,6 +113,8 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
Xorriso_update_volid(xorriso, 0);
xorriso->volset_change_pending= 0;
xorriso->boot_count= 0;
xorriso->system_area_clear_loaded=
(strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0);
xorriso->no_volset_present= 0;
return(1);
}

View File

@ -1006,6 +1006,8 @@ treatment_patch:;
if(ret <= 0)
goto ex;
xorriso->system_area_options&= ~0x4000;
if(strcmp(treatpt + 12, "/dev/zero") == 0)
xorriso->system_area_clear_loaded= 1;
} else if(strncmp(treatpt, "partition_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0) {

View File

@ -440,7 +440,10 @@ int Xorriso_set_system_area(struct XorrisO *xorriso, struct burn_drive *drive,
Xorriso_alloc_meM(buf, char, 32768);
memset(buf, 0, 32768);
system_area_options= xorriso->system_area_options;
sa_loaded= iso_image_get_system_area(img, buf, &options, 0);
if(xorriso->system_area_clear_loaded)
sa_loaded= 0;
else
sa_loaded= iso_image_get_system_area(img, buf, &options, 0);
if(sa_loaded < 0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", sa_loaded,

View File

@ -411,6 +411,7 @@ struct XorrisO { /* the global context of xorriso */
1= appy --efi-boot parameters when attaching to img */
char system_area_disk_path[SfileadrL];
int system_area_clear_loaded;
int system_area_options; /* bit0= "GRUB protective msdos label"
(a simple partition table)
bit1= isohybrid boot image pointer

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.12.22.133736"
#define Xorriso_timestamP "2015.12.23.112013"