Skip to content

Commit

Permalink
master: Strip '\n' from suid_dumpable read buffer before str_to_uint()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj authored and villesavolainen committed Mar 13, 2018
1 parent f6b8fa4 commit 2677b2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/master/service-process.c
Expand Up @@ -461,6 +461,8 @@ static bool linux_proc_fs_suid_is_dumpable(unsigned int *value_r)
*value_r = 0;
} else {
buf[ret] = '\0';
if (ret > 0 && buf[ret-1] == '\n')
buf[ret-1] = '\0';
if (str_to_uint(buf, value_r) < 0)
*value_r = 0;
}
Expand Down

0 comments on commit 2677b2c

Please sign in to comment.