]> granicus.if.org Git - strace/commitdiff
2005-02-05 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Sun, 6 Feb 2005 01:55:07 +0000 (01:55 +0000)
committerRoland McGrath <roland@redhat.com>
Sun, 6 Feb 2005 01:55:07 +0000 (01:55 +0000)
* util.c (printpath, printpathn): Print NULL and don't try any fetch
when ADDR is zero.
Fixes Debian bug #63093.

util.c

diff --git a/util.c b/util.c
index 31e56cab22d164db6fec9260aa03e4a3a6841bbd..d445b0c4d8e1ffd31f2151fb15a811a189cbd775 100644 (file)
--- a/util.c
+++ b/util.c
@@ -372,7 +372,9 @@ printpath(tcp, addr)
 struct tcb *tcp;
 long addr;
 {
-       if (umovestr(tcp, addr, MAXPATHLEN, path) < 0)
+       if (addr == 0)
+               tprintf("NULL");
+       else if (umovestr(tcp, addr, MAXPATHLEN, path) < 0)
                tprintf("%#lx", addr);
        else
                string_quote(path);
@@ -385,7 +387,9 @@ struct tcb *tcp;
 long addr;
 int n;
 {
-       if (umovestr(tcp, addr, n, path) < 0)
+       if (addr == 0)
+               tprintf("NULL");
+       else    if (umovestr(tcp, addr, n, path) < 0)
                tprintf("%#lx", addr);
        else {
                path[n] = '\0';