udev: fix codesonar warnings
authorAmitanand.Chikorde <amitanand.chikorde@kpit.com>
Thu, 30 Jul 2020 13:18:48 +0000 (18:48 +0530)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 20 Sep 2020 10:33:23 +0000 (12:33 +0200)
commit674a2beff0ac7b1cb0358401d6f64d726bca4e4f
tree3ade77f9f29202b19879201f2f1d9acc6581396f
parent16477684d2922b17c63e6799225bf2b92a020a80
udev: fix codesonar warnings

Fixed below systemd codesonar warning.
isprint() is invoked here with an argument of signed
type char, but only has defined behavior for int arguments that are
either representable as unsigned char or equal to the value
of macro EOF(-1).

As per codesonar report, in a number of libc implementations, isprint()
function implemented using lookup tables (arrays): passing in a
negative value can result in a read underrun.

(cherry picked from commit e7e954243a17cceb5278aac6249ee0dcc119b1eb)
(cherry picked from commit 1b9c95bfbf7e5fc32e033851bf06f0a9f7f9f08b)
src/udev/udevadm-info.c