procfs: improve parsing of stat file 73/185173/1
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 26 Jul 2018 10:25:28 +0000 (12:25 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 26 Jul 2018 12:24:13 +0000 (14:24 +0200)
commitc9607839e6806ae3cfcd37c545728b95f48c51dd
tree1255a58d1e878964ad5f3dc07b4efaea44a4875e
parentfe365e77fa99790bf2bb2370a52f5258daf10ebe
procfs: improve parsing of stat file

In rare situation when process could have malicious name
containing some tricky characters like whitespaces and numbers -
the parsing result may be wrong.
This patch fixes this issue by loading whole stat file into
memory and then proceed with parsing.

Change-Id: Iede6e0b6d1362a56449e1a53a0348f6cd7b4f768
src/procfs.c