diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-11-09 12:40:14 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-11-09 12:40:14 +0000 |
commit | 62399c99417fc22fe10cf2f88e862b00d31cdc7a (patch) | |
tree | 257250242da6d404841a617847fdf8d825d85c5f /mbox.c | |
parent | b7ea37ab66bce53928433639f76b4c63efaf48c2 (diff) |
Add some more sanity checks about content-length.
Diffstat (limited to 'mbox.c')
-rw-r--r-- | mbox.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |