summaryrefslogtreecommitdiffstats
path: root/mbox.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-11-09 12:40:14 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-11-09 12:40:14 +0000
commit62399c99417fc22fe10cf2f88e862b00d31cdc7a (patch)
tree257250242da6d404841a617847fdf8d825d85c5f /mbox.c
parentb7ea37ab66bce53928433639f76b4c63efaf48c2 (diff)
Add some more sanity checks about content-length.
Diffstat (limited to 'mbox.c')
-rw-r--r--mbox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mbox.c b/mbox.c
index a715c191..07dc7e6a 100644
--- a/mbox.c
+++ b/mbox.c
@@ -155,7 +155,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
{
tmploc = loc + hdr->content->length;
- if (tmploc < ctx->size)
+ if (0 < tmploc && tmploc < ctx->size)
{
if (fseek (ctx->fp, tmploc, SEEK_SET) != 0 ||
fgets (buf, sizeof (buf) - 1, ctx->fp) == NULL ||
@@ -298,7 +298,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
loc = ftell (ctx->fp);
tmploc = loc + curhdr->content->length + 1;
- if (tmploc < ctx->size)
+ if (0 < tmploc && tmploc < ctx->size)
{
/*
* check to see if the content-length looks valid. we expect to