commit 5b16e8a4eb5075155ff87ec5595abeb705a6aab4
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Sat Mar 26 15:46:29 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Apr 20 23:08:51 2016 +0100
pwdx: fix off-by-one bug
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/pwdx.c b/pwdx.c
index 57adc72..b169d75 100644
--- a/pwdx.c
+++ b/pwdx.c
_AT_@ -31,7 +31,7 @@ main(int argc, char *argv[])
for (; argc > 0; argc--, argv++) {
n = snprintf(path, sizeof(path), "/proc/%s/cwd", *argv);
- if (n < 0 || n > sizeof(path)) {
+ if (n < 0 || n >= sizeof(path)) {
errno = ESRCH;
} else {
n = readlink(path, target, sizeof(target) - 1);
Received on Thu Apr 21 2016 - 00:08:58 CEST
This archive was generated by hypermail 2.3.0
: Thu Apr 21 2016 - 00:13:05 CEST