From: Roland McGrath Date: Sun, 6 Feb 2005 01:55:07 +0000 (+0000) Subject: 2005-02-05 Roland McGrath X-Git-Tag: v4.5.18~416 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=371ed8fceca7e2812a5edbaab2db2cce966dc0e8;p=strace 2005-02-05 Roland McGrath * util.c (printpath, printpathn): Print NULL and don't try any fetch when ADDR is zero. Fixes Debian bug #63093. --- diff --git a/util.c b/util.c index 31e56cab..d445b0c4 100644 --- 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';