summaryrefslogtreecommitdiffstats
path: root/src/godmode.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-04-14 12:23:23 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-04-14 12:23:23 +0200
commit33222ee2fc2c5143ebf15e682a226ce67fecbf3d (patch)
tree2ed844b3574d989801240ee91f16e5fc462edb3e /src/godmode.c
parent1217b9fd735ee4acae5a5894923256eebd259863 (diff)
TestDisk: when searching partition near the end of the disk, stops if there is a read error
Diffstat (limited to 'src/godmode.c')
-rw-r--r--src/godmode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/godmode.c b/src/godmode.c
index d17ce7d..42b967e 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -655,7 +655,7 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
test_nbr++;
}
else
- test_nbr=12;
+ test_nbr=13;
}
if(res<=0 && test_nbr==8)
{
@@ -687,7 +687,7 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
res=search_type_128(buffer_disk,disk_car,partition,verbose,dump_ind);
test_nbr++;
}
- if(test_nbr==13)
+ if(test_nbr>=13)
{
sector_inc=1;
test_nbr=0;
@@ -702,6 +702,9 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
wprintw(stdscr,msg_READ_ERROR_AT, start.cylinder,start.head,start.sector,(unsigned long)(partition->part_offset/disk_car->sector_size));
}
#endif
+ /* Stop reading after the end of the disk */
+ if(search_location >= disk_car->disk_real_size)
+ search_location = search_location_max;
}
else if(res>0)
{