Skip to content
Snippets Groups Projects
Commit d292650e authored by Brian Carrier's avatar Brian Carrier
Browse files

Fixed GPT calculation with 512 hardcoded

parent 0014a3bc
No related branches found
No related tags found
No related merge requests found
......@@ -125,7 +125,7 @@ gpt_load_table(TSK_VS_INFO * vs)
snprintf(head_str, 16, "GPT Header");
if (NULL == tsk_vs_part_add(vs, (TSK_DADDR_T) 1,
(TSK_DADDR_T) ((tsk_getu32(vs->endian,
&head->head_size_b) + 511) / 512),
&head->head_size_b) + (vs->block_size-1)) / vs->block_size),
TSK_VS_PART_FLAG_META, head_str, -1, -1)) {
free(sect_buf);
return 1;
......@@ -151,7 +151,7 @@ gpt_load_table(TSK_VS_INFO * vs)
if (NULL == tsk_vs_part_add(vs, (TSK_DADDR_T) tsk_getu64(vs->endian,
&head->tab_start_lba),
(TSK_DADDR_T) ((ent_size * tsk_getu32(vs->endian,
&head->tab_num_ent) + 511) / 512),
&head->tab_num_ent) + (vs->block_size-1)) / vs->block_size),
TSK_VS_PART_FLAG_META, tab_str, -1, -1)) {
free(sect_buf);
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment