summaryrefslogtreecommitdiffstats
path: root/src/godmode.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-03-21 08:33:10 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2014-03-21 08:33:10 +0100
commit79b567c4e6d0bda71d1d816fda7aaae1c3990e8b (patch)
tree921faa32de9f352da41ca5fcd48b7872b4bd9b24 /src/godmode.c
parent6d89d174d730c8804caf6a2c47dee500d140003d (diff)
Add assert() to document function assumptions in MALLOC(), pfind_sectors_per_cluster() and search_part()
Diffstat (limited to 'src/godmode.c')
-rw-r--r--src/godmode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/godmode.c b/src/godmode.c
index 3e8107b..af2b6f2 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -27,6 +27,7 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <assert.h>
#include "types.h"
#include "common.h"
#include "fnctdsk.h"
@@ -537,6 +538,7 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
((uint64_t) disk_car->geom.heads_per_cylinder * disk_car->geom.sectors_per_head * disk_car->sector_size) + 1 ) *
((uint64_t) disk_car->geom.heads_per_cylinder * disk_car->geom.sectors_per_head * disk_car->sector_size),
disk_car->disk_real_size);
+ assert(disk_car->sector_size>0);
partition=partition_new(disk_car->arch);
buffer_disk=(unsigned char*)MALLOC(16*DEFAULT_SECTOR_SIZE);
buffer_disk0=(unsigned char*)MALLOC(16*DEFAULT_SECTOR_SIZE);