From 8c19f0f52076f72d59d97ab41902ca29f5b92520 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 13 Jan 2013 13:33:32 +0100 Subject: [PATCH] Minor fix in linux.cc --- src/linux.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/linux.cc b/src/linux.cc index 06907699..5010ba3c 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -2649,6 +2649,9 @@ static void process_parse_stat(struct process *process) endl = read(ps, line, BUFFER_LEN - 1); close(ps); + if(endl < 0) + return; + line[endl] = 0; /* account for "kdeinit: " */ if ((char *) line == strstr(line, "kdeinit: ")) {