mirror of
https://github.com/git/git.git
synced 2026-01-25 10:03:24 +00:00
Check for EOF while parsing mails
Reported via Coverity. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -232,7 +232,7 @@ static int split_mbox(const char *file, const char *dir, int allow_bare,
|
||||
|
||||
do {
|
||||
peek = fgetc(f);
|
||||
} while (isspace(peek));
|
||||
} while (peek >= 0 && isspace(peek));
|
||||
ungetc(peek, f);
|
||||
|
||||
if (strbuf_getwholeline(&buf, f, '\n')) {
|
||||
|
||||
@@ -1094,7 +1094,7 @@ int mailinfo(struct mailinfo *mi, const char *msg, const char *patch)
|
||||
|
||||
do {
|
||||
peek = fgetc(mi->input);
|
||||
} while (isspace(peek));
|
||||
} while (peek >= 0 && isspace(peek));
|
||||
ungetc(peek, mi->input);
|
||||
|
||||
/* process the email header */
|
||||
|
||||
Reference in New Issue
Block a user