From 5c065e96880ce8872d60e097ffb719e640b95b84 Mon Sep 17 00:00:00 2001 From: Jelena Mirkovic Date: Mon, 28 Mar 2022 11:47:15 -0700 Subject: [PATCH] Fixed a bug --- amonsenss.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/amonsenss.cc b/amonsenss.cc index 41e2a74..72500bc 100644 --- a/amonsenss.cc +++ b/amonsenss.cc @@ -1725,6 +1725,9 @@ double read_one_line(void* nf, char* format, char* line, u_char* p, struct pcap if (!strcmp(format, "nf") || !strcmp(format, "ft") || !strcmp(format,"fr")) { char* s = fgets(line, MAXLINE, (FILE*) nf); + if (s == NULL) + return -1; + char tmpline[MAXLINE]; strcpy(tmpline, line);