New bootspec "gpt_disk_guid=", new -as mkisofs option --gpt_disk_guid, new -report_system_area mode "make_guid"

This commit is contained in:
2016-08-12 18:57:21 +00:00
parent 79a45f90f6
commit d4be334960
18 changed files with 322 additions and 113 deletions

View File

@ -1083,10 +1083,12 @@ int Hex_to_bin(char *hex,
int i, l, acc;
l= strlen(hex);
if(l % 2 || l == 0)
if(((l % 2) && l < 2 * bin_size) || l == 0)
return(-1); /* malformed */
*bin_count= 0;
for(i= 0; i < l; i+= 2) {
if(*bin_count >= bin_size)
return(0); /* overflow */
if(hex[i] >= '0' && hex[i] <= '9')
acc= (hex[i] - '0') << 4;
else if(hex[i] >= 'A' && hex[i] <= 'F')
@ -1103,8 +1105,6 @@ int Hex_to_bin(char *hex,
acc|= (hex[i + 1] - 'a' + 10);
else
return(-1);
if(*bin_count >= bin_size)
return(0); /* overflow */
bin_data[*bin_count]= acc;
(*bin_count)++;
}