Make sure return value of fgetc isn't truncated

remotes/origin/master-1.1.x
Gerardo Iglesias Galvan 15 years ago committed by Victor Julien
parent bd6d1bfac4
commit 58f713254e

@ -625,7 +625,7 @@ void SCThresholdConfParseFile(DetectEngineCtx *de_ctx, FILE *fd)
{ {
char *line = NULL; char *line = NULL;
int len = 0; int len = 0;
char c; int c;
int rule_num = 0; int rule_num = 0;
/* position of "\", on multiline rules */ /* position of "\", on multiline rules */
@ -648,7 +648,8 @@ void SCThresholdConfParseFile(DetectEngineCtx *de_ctx, FILE *fd)
break; break;
} }
if (fgets(line + esc_pos, len + 1, fd) == NULL) break; if (fgets(line + esc_pos, len + 1, fd) == NULL)
break;
/* Skip EOL to inspect the next line (or read EOF) */ /* Skip EOL to inspect the next line (or read EOF) */
c = fgetc(fd); c = fgetc(fd);

Loading…
Cancel
Save