aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Aleksey Manevich <manevich.aleksey@gmail.com>2016-09-06 01:19:41 +0300
committerLibravatar Aleksey Manevich <manevich.aleksey@gmail.com>2016-09-06 01:21:40 +0300
commite633e923d3f45af8e0142f04fbae08e0e1d5e0ca (patch)
treec5bca65bea522c3afca9eaef71114db74c7da510
parentbringing back --private-home (diff)
downloadfirejail-e633e923d3f45af8e0142f04fbae08e0e1d5e0ca.tar.gz
firejail-e633e923d3f45af8e0142f04fbae08e0e1d5e0ca.tar.zst
firejail-e633e923d3f45af8e0142f04fbae08e0e1d5e0ca.zip
fix read_pid
-rw-r--r--src/firejail/main.c3
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;