pmap: avoid depending on an uninitialised value.
authorAdam Sampson <ats@offog.org>
Wed, 30 Apr 2014 13:20:21 +0000 (14:20 +0100)
committerJaromir Capik <jcapik@redhat.com>
Tue, 19 Aug 2014 16:59:28 +0000 (18:59 +0200)
commit1d212457f223dd7bde32b981244278d78952b0dd
tree94ab464321f038687b55245421af2e0fac5e6458
parent12f13f9fc228c14e5ed941f4d0ac32cf30119f2a
pmap: avoid depending on an uninitialised value.

It's possible for the first entry that this reads from /proc/*/smaps to
start with a map_desc-less line like this:

7fa71b77d000-7fa71c288000 rw-p 00000000 00:00 0

in which case sscanf will only read up to inode, and it won't set c; the
code below would then incorrectly discard the next ("Size:") line.

(With GCC 4.9.0, this bug causes the "pmap extra extended output" test
to fail for me.)
pmap.c