summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-08-11 16:00:55 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2019-08-11 16:00:55 +0200
commit06cbf2fe16da77628151b93f0740139d98177da9 (patch)
tree2a124018f95fdaa3286d4eb808f893b409a94bfb
parent20d96c6668052fddd0169706dbc05d1fb7ada17c (diff)
src/filegen.c: move the conditional check outside the loop in index_header_check_aux()
-rw-r--r--src/filegen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/filegen.c b/src/filegen.c
index 61bd77c..63a27d6 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -98,12 +98,12 @@ void register_header_check(const unsigned int offset, const void *value, const u
static void index_header_check_aux(file_check_t *file_check_new)
{
- struct td_list_head *tmp;
- td_list_for_each(tmp, &file_check_list.list)
+ if(file_check_new->length>0)
{
- file_check_list_t *pos=td_list_entry(tmp, file_check_list_t, list);
- if(file_check_new->length>0)
+ struct td_list_head *tmp;
+ td_list_for_each(tmp, &file_check_list.list)
{
+ file_check_list_t *pos=td_list_entry(tmp, file_check_list_t, list);
if(pos->offset >= file_check_new->offset &&
pos->offset < file_check_new->offset+file_check_new->length)
{