]> git.ipfire.org Git - thirdparty/util-linux.git/commit
ipcs: make sure to parse whole lines for shm_data
authorRuediger Meier <ruediger.meier@ga-group.nl>
Fri, 18 Mar 2016 11:49:17 +0000 (12:49 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Mar 2016 14:38:05 +0000 (15:38 +0100)
commit97fab80eaf210fb23e106a2cd4ec6dd998cd520d
treec1ab302bc82459d9858f934651cdb7cec449901f
parent6c44094af621c011135e758b0d5e175dfe344e90
ipcs: make sure to parse whole lines for shm_data

We want to parse 16 columns _per_row_ without mixing them up. The
existing code is unsafe for more or less columns and could even
run into endless loops. This patch assures that we parse row-wise
and really skip lines with columns != 16.

Probably somehow we could have also done this with fscanf() only.
Using fgets() additionally makes the code more easy to read and
to improve later.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
sys-utils/ipcutils.c