Skip to content
Snippets Groups Projects
Commit 0dc09cbc authored by Ann Priestman's avatar Ann Priestman
Browse files

Add check that the extended partition has not already been added

parent 1833d44c
No related branches found
No related tags found
No related merge requests found
...@@ -751,6 +751,25 @@ dos_load_ext_table(TSK_VS_INFO * vs, TSK_DADDR_T sect_cur, ...@@ -751,6 +751,25 @@ dos_load_ext_table(TSK_VS_INFO * vs, TSK_DADDR_T sect_cur,
* in extended partitions */ * in extended partitions */
if (dos_is_ext(part->ptype)) { if (dos_is_ext(part->ptype)) {
TSK_VS_PART_INFO *part_info;
/* Sanity check to prevent infinite recursion in dos_load_ext_table.
* If we already have a partition with this starting address then
* return an error. This will prevent any more partitions from being
* added but will leave any existing partitions alone. */
part_info = vs->part_list;
while (part_info != NULL) {
if (part_info->start == (TSK_DADDR_T)(sect_ext_base + part_start)) {
if (tsk_verbose)
tsk_fprintf(stderr,
"Starting sector %" PRIuDADDR
" of extended partition has already been used\n",
(TSK_DADDR_T)(sect_ext_base + part_start));
return 1;
}
part_info = part_info->next;
}
/* part start is added to the start of the /* part start is added to the start of the
* first extended partition (the primary * first extended partition (the primary
* extended partition) */ * extended partition) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment