Commit 16a83b4f authored by Mike Frysinger's avatar Mike Frysinger

lib: masq_info: check fgets return value

parent df48bbef
...@@ -174,7 +174,11 @@ int ip_masq_info(int numeric_host, int numeric_port, int ext) ...@@ -174,7 +174,11 @@ int ip_masq_info(int numeric_host, int numeric_port, int ext)
fclose(f); fclose(f);
return (-1); return (-1);
} }
fgets(buf, sizeof(buf), f); if (fgets(buf, sizeof(buf), f) == NULL) {
EINTERN("masq_info", "fgets() failed");
fclose(f);
return (-1);
}
has_pdelta = strstr(buf, "PDelta") ? 1 : 0; has_pdelta = strstr(buf, "PDelta") ? 1 : 0;
mslist = (struct masq *) malloc(16 * sizeof(struct masq)); mslist = (struct masq *) malloc(16 * sizeof(struct masq));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment