aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa/ufsread.c
diff options
context:
space:
mode:
Diffstat (limited to 'stand/libsa/ufsread.c')
-rw-r--r--stand/libsa/ufsread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stand/libsa/ufsread.c b/stand/libsa/ufsread.c
index 0f9b9bb4e2fb..86ac8fbbbab7 100644
--- a/stand/libsa/ufsread.c
+++ b/stand/libsa/ufsread.c
@@ -108,6 +108,13 @@ fsfind(const char *name, ufs_ino_t * ino)
*ino = d.d_ino;
return d.d_type;
}
+ /*
+ * Check for corrupt directory entry and bail out
+ * rather than spin forever hoping that the user
+ * has other options.
+ */
+ if (d.d_reclen == 0)
+ return 0;
s += d.d_reclen;
}
if (n != -1 && ls)