New bootspec "gpt_disk_guid=", new -as mkisofs option --gpt_disk_guid, new -report_system_area mode "make_guid"
This commit is contained in:
@ -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)++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user