From 4d14a29026d1edd8ba118c1b33a03307b8ac2d46 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 1 Sep 1995 18:09:20 +0000 Subject: [PATCH] Check a pointer in skipdirs() before dereferencing it. I don't fully understand why it can become a null pointer under some circumstances, but i've got a pile of tapes where this happens, and running it thru a debugger proved that simply ending the loop in this case did the right thing. Anyway, it cannot make it worse than now, where restore kills itself with "Memory fault". --- sbin/restore/dirs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 8860f5b05d0f..2f8f2e6bda7a 100644 --- a/sbin/restore/dirs.c +++ b/sbin/restore/dirs.c @@ -201,7 +201,7 @@ void skipdirs() { - while ((curfile.dip->di_mode & IFMT) == IFDIR) { + while (curfile.dip && (curfile.dip->di_mode & IFMT) == IFDIR) { skipfile(); } }