From 371ed8fceca7e2812a5edbaab2db2cce966dc0e8 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 6 Feb 2005 01:55:07 +0000 Subject: [PATCH] 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. --- util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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'; -- 2.50.1