commit | ee8701d501325c74bbbd294da4142e3cbfc988fe | [log] [tgz] |
---|---|---|
author | Quentin Rameau <quinq@fifth.space> | Thu Feb 18 15:16:25 2016 +0100 |
committer | sin <sin@2f30.org> | Thu Feb 18 14:18:49 2016 +0000 |
tree | ea18ed177c17ab4fb95b2a19571cce2d29255b36 | |
parent | 1024369f2da0bb7796ae057d6b8523fdf7dd8a31 [diff] |
ls: check for the index size before using it in visit() Thanks to k0ga for noticing it!
diff --git a/ls.c b/ls.c index e55c7c5..7c97558 100644 --- a/ls.c +++ b/ls.c
@@ -311,7 +311,7 @@ dev = ent->dev; ino = S_ISLNK(ent->mode) ? ent->tino : ent->ino; - for (i = 0; tree[i].ino && i < PATH_MAX; ++i) { + for (i = 0; i < PATH_MAX && tree[i].ino; ++i) { if (ino == tree[i].ino && dev == tree[i].dev) return -1; }