Commit 7e91281f authored by Jiri Popelka's avatar Jiri Popelka Committed by Bernd Eckenfels

netstat: check fstat's return value

parent 8217b88b
......@@ -1574,8 +1574,8 @@ static int ipx_info(void)
/* We need to check for directory */
if (f) {
fstat(fileno(f), &s);
if (!S_ISREG(s.st_mode)) {
if (fstat (fileno(f), &s) == -1 ||
!S_ISREG(s.st_mode)) {
fclose(f);
f=NULL;
}
......
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