Commit 84c65f00 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

proc_parse: handle errors for breadline()

00:03:27.746 (00.008815) Error (bfd.c:149): bfd: Error reading file: No such process

Reported-by: Mr Jenkins
Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a2a0e2f2
...@@ -533,6 +533,8 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list) ...@@ -533,6 +533,8 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list)
char *str; char *str;
str = breadline(&f); str = breadline(&f);
if (IS_ERR(str))
goto err;
eof = (str == NULL); eof = (str == NULL);
if (!eof && !is_vma_range_fmt(str)) { if (!eof && !is_vma_range_fmt(str)) {
...@@ -761,7 +763,13 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr) ...@@ -761,7 +763,13 @@ int parse_pid_status(pid_t pid, struct proc_status_creds *cr)
if (bfdopenr(&f)) if (bfdopenr(&f))
return -1; return -1;
while (done < 8 && (str = breadline(&f))) { while (done < 8) {
str = breadline(&f);
if (str == NULL)
break;
if (IS_ERR(str))
goto err_parse;
if (!strncmp(str, "State:", 6)) { if (!strncmp(str, "State:", 6)) {
cr->state = str[7]; cr->state = str[7];
done++; done++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment