From 9996aac55eeac4136e7987e850c7e7bcb6437c0f Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 1 Sep 1995 18:09:20 +0000 Subject: 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(-) (limited to 'sbin/restore') diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 8860f5b..2f8f2e6 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(); } } -- cgit v1.1