Introduction
Introduction Statistics Contact Development Disclaimer Help
pwdx: fix off-by-one bug - ubase - suckless linux base utils
git clone git://git.suckless.org/ubase
Log
Files
Refs
README
LICENSE
---
commit 5b16e8a4eb5075155ff87ec5595abeb705a6aab4
parent f26a1449bfa18a6fbbe263f084df4e490772e9d3
Author: Mattias Andrée <[email protected]>
Date: Sat, 26 Mar 2016 15:46:29 +0100
pwdx: fix off-by-one bug
Signed-off-by: Mattias Andrée <[email protected]>
Diffstat:
M pwdx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pwdx.c b/pwdx.c
@@ -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);
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.