]> granicus.if.org Git - strace/commitdiff
pathtrace: fix umovestr return code check
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Feb 2013 19:23:27 +0000 (19:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Feb 2013 22:11:29 +0000 (22:11 +0000)
* pathtrace.c (upathmatch): Only NUL-terminated strings can be
path-matched, so fix the umovestr return code check to filter out
unsuitable strings.

pathtrace.c

index f202c99fbbdec7e92d1629ddc85252bfe9b07188..83d79d3763ed1f12fdad8c31360194d2fb95cee7 100644 (file)
@@ -65,7 +65,7 @@ upathmatch(struct tcb *tcp, unsigned long upath)
 {
        char path[PATH_MAX + 1];
 
-       return umovestr(tcp, upath, sizeof path, path) >= 0 &&
+       return umovestr(tcp, upath, sizeof path, path) > 0 &&
                pathmatch(path);
 }