]> granicus.if.org Git - procps-ng/commit
library: avoid SEGV if file2str should read zero bytes
authorJim Warner <james.warner@comcast.net>
Sat, 30 Mar 2013 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sun, 7 Apr 2013 07:35:49 +0000 (17:35 +1000)
commit526bc5dfa924177e68be0123bd67e3370955f924
tree5ea017d2a0b29b695f4ac29b437dcea941f84cf8
parent6d605f521c54a7011b7a255762621febda4f67e8
library: avoid SEGV if file2str should read zero bytes

When utility buffers were introduced for file2str read
requests, a subtle change was inadvertently introduced
such that a read of zero no longer returns a -1 value.

This commit ensures that zero bytes read returns a -1.

And although the solution differs from a merge request
submitted by sergey.senozhatsky@gmail.com, a thank you
is offered for revealing this potential abend problem.

References(s):
commit a45dace4b82c9cdcda7020ca5665153b1e81275f
http://gitorious.org/procps/procps/merge_requests/11

Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Craig Small <csmall@enc.com.au>
proc/readproc.c