iproute2/misc
Michał Łyszczek eca5123948 libnetlink.c, ss.c: properly handle fread() errors
fread(3) returns size_t data type which is unsigned, thus check
`if (fread(...) < 0)' is always false. To check if fread(3) has
failed, user should check error indicator with ferror(3).

This commit also changes read logic a little bit by being less
forgiving for errors. Previous logic was checking if fread(3)
read *at least* required ammount of data, now code checks if
fread(3) read *exactly* expected ammount of data. This makes
sense because code parses very specific binary file, and reading
even 1 less/more byte than expected, will later corrupt data anyway.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-11-01 09:05:41 -07:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
Makefile Pass CPPFLAGS to the compiler 2018-11-09 08:07:18 -08:00
arpd.c libnetlink: Add filter function to rtnl_neighdump_req 2019-01-04 12:17:11 -08:00
ifstat.c Tree wide: Drop sockaddr_nl arg 2018-10-22 09:43:48 -07:00
lnstat.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
lnstat.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
lnstat_util.c lnstat_util: Make sure buffer is NUL-terminated 2017-09-01 12:10:54 -07:00
nstat.c treewide: refactor help messages 2019-05-20 14:35:07 -07:00
rtacct.c misc: fix style issues 2016-03-21 11:56:36 -07:00
ss.c libnetlink.c, ss.c: properly handle fread() errors 2019-11-01 09:05:41 -07:00
ssfilter.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
ssfilter.y ssfilter: Fix for inverted last expression 2018-12-03 14:33:19 -08:00