NetBSD/bin
kamil 0e68b604ab Fix an unitialized memory read bug in ps(1)
rawcpu of type int, is declared inside main(){} and it can be passed as
uninitialized to setpinfo().
The setpinfo() function has a switch checking the value of rawcpu:

  if (!rawcpu)
    pi[i].pcpu /= 1.0 - exp(ki[i].p_swtime * log_ccpu);

rawcpu is set to 1 with the command line argument "-C".

   -C           Change the way the CPU percentage is calculated by using a
                "raw" CPU calculation that ignores "resident" time (this
                normally has no effect).

Bug reproducible with an invocation: "ps u". It hides with "ps uC".

Initialize rawcpu by default to 0, before the getopt(3) machinery.

Detected with MSan running on NetBSD/amd64.

Sponsored by <The NetBSD Foundation>
2018-01-12 23:01:14 +00:00
..
cat Add cross reference to tac(1). 2017-10-02 08:24:17 +00:00
chio typo: unvalid -> invalid 2017-10-16 17:08:35 +00:00
chmod
cp
csh
date
dd
df
domainname
echo
ed
expr
hostname
kill
ksh
ln
ls
mkdir
mt
mv
pax Include time.h for time(2). Sort. 2017-10-02 21:55:35 +00:00
ps Fix an unitialized memory read bug in ps(1) 2018-01-12 23:01:14 +00:00
pwd
rcmd
rcp
rm
rmdir PR/48182: Fix rmdir -p handling of top-level (root) directory. 2017-08-10 22:52:13 +00:00
sh In addition to previous the which fixed a (harmless) MSAN detected ref 2017-12-30 23:24:19 +00:00
sleep
stty Remove Tn. 2017-10-30 15:38:52 +00:00
sync
test Remove unnecessary Tn. 2017-10-18 18:11:54 +00:00
Makefile
Makefile.inc