The packet and netlink fallback parsers use sscanf() to read records from
/proc. Both paths used the output variables without first checking that
all expected fields were present.
Require a complete record before filtering or printing it. This prevents
malformed input from leaving socket fields uninitialized.
Tested with a full iproute2 build.
Prabhakar Pujeri (2):
ss: validate sscanf() return value in packet_show_line()
ss: validate sscanf() return value in netlink_show()
misc/ss.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--
2.55.0