diff options
author | 2016-09-06 08:13:24 -0400 | |
---|---|---|
committer | 2016-09-06 08:13:24 -0400 | |
commit | 37983ae6a674d76c2cdacc036f8a8eed79d7d716 (patch) | |
tree | c5bca65bea522c3afca9eaef71114db74c7da510 | |
parent | bringing back --private-home (diff) | |
parent | fix read_pid (diff) | |
download | firejail-37983ae6a674d76c2cdacc036f8a8eed79d7d716.tar.gz firejail-37983ae6a674d76c2cdacc036f8a8eed79d7d716.tar.zst firejail-37983ae6a674d76c2cdacc036f8a8eed79d7d716.zip |
Merge pull request #766 from manevich/fixes
fix read_pid
-rw-r--r-- | src/firejail/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index 94000d917..569fc7add 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -161,7 +161,8 @@ static inline int read_pid(char *str, pid_t *pid) { | |||
161 | || (errno != 0 && pidtmp == 0)) { | 161 | || (errno != 0 && pidtmp == 0)) { |
162 | return 1; | 162 | return 1; |
163 | } | 163 | } |
164 | if (endptr == str) { | 164 | // endptr points to '\0' char in str if the entire string is valid |
165 | if (endptr == NULL || endptr[0]!='\0') { | ||
165 | return 1; | 166 | return 1; |
166 | } | 167 | } |
167 | *pid = (pid_t)pidtmp; | 168 | *pid = (pid_t)pidtmp; |