Browse Source

Abort on prematurate EOF when reading headers

tags/v0.1.0
Damien Goutte-Gattat 9 years ago
parent
commit
c7aafcc2f3
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/fmail.c

+ 4
- 0
src/fmail.c View File

@@ -236,6 +236,10 @@ read_headers(FILE *in, string_buffer_t *headers)
n = 0;
}
}
else if ( c == EOF ) {
/* EOF before reaching the end of headers, abort. */
errx(EXIT_FAILURE, "cannot read mail headers");
}
else {
sb_addc(headers, c);
n += 1;


Loading…
Cancel
Save