summaryrefslogtreecommitdiffstats
path: root/sbin/restore
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-09-01 18:09:20 +0000
committerjoerg <joerg@FreeBSD.org>1995-09-01 18:09:20 +0000
commit9996aac55eeac4136e7987e850c7e7bcb6437c0f (patch)
tree0ed11a7cc67981bc41e76873a9bc2ff91730d413 /sbin/restore
parent79384fe51ba855fe3a49375f8f23ce361c63021c (diff)
downloadFreeBSD-src-9996aac55eeac4136e7987e850c7e7bcb6437c0f.zip
FreeBSD-src-9996aac55eeac4136e7987e850c7e7bcb6437c0f.tar.gz
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".
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/dirs.c2
1 files changed, 1 insertions, 1 deletions
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();
}
}
OpenPOWER on IntegriCloud