Skip to content
Commit ec863205 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov
Browse files

read_ns_sys_file(): don't overrun buf



This is a classical off-by-one error. If sizeof(buf) is 512,
the last element is buf[511] but not buf[512].

Note that if read() returns 0, we return 0 but buf stays
uninitialized.

Reported by Coverity, CID 114623.

Signed-off-by: default avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent 377763e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment