summaryrefslogtreecommitdiffstats
path: root/src/file_txt.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-09-10 22:16:40 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-09-10 22:16:40 +0200
commit6cbb862854011bf8fec7f17a303563faa9b953eb (patch)
tree0db867cd267aeb48aef035f0577efe4f41362159 /src/file_txt.c
parent86b2772988185c19382ec0d755389a3c897166bf (diff)
Check i before using it as index
Diffstat (limited to 'src/file_txt.c')
-rw-r--r--src/file_txt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file_txt.c b/src/file_txt.c
index e6231b5..8d1ab16 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -640,7 +640,7 @@ static int header_check_mbox(const unsigned char *buffer, const unsigned int buf
{
unsigned int i;
/* From someone@somewhere */
- for(i=5; buffer[i]!=' ' && buffer[i]!='@' && i<200; i++);
+ for(i=5; i<200 && buffer[i]!=' ' && buffer[i]!='@'; i++);
if(buffer[i]!='@')
return 0;
}