2005-02-05 Roland McGrath <roland@redhat.com>

* util.c (printpath, printpathn): Print NULL and don't try any fetch
	when ADDR is zero.
	Fixes Debian bug #63093.
This commit is contained in:
Roland McGrath 2005-02-06 01:55:07 +00:00
parent 854694b087
commit 371ed8fcec

8
util.c
View File

@ -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';