]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the check in dircheck() on namlen.
authordelphij <delphij@FreeBSD.org>
Fri, 2 Sep 2011 17:05:34 +0000 (17:05 +0000)
committerdelphij <delphij@FreeBSD.org>
Fri, 2 Sep 2011 17:05:34 +0000 (17:05 +0000)
commit0e6cabaab185606f0cd69428aa2a8084349da3a9
tree41ce238750e2d318d4e2f9be352892921bfa9b88
parent3cf33970bf0ab33ba3a8f7a526e67ccc47e341e6
Fix the check in dircheck() on namlen.

The value of namlen is copied from on-disk d_namlen, which is a 8-bit
unsigned integer which can never exceed MAXNAMLEN (255) so the test is
always true.  Moreover, UFS does not allow d_namelen being zero.

Change namlen from u_int to u_int8_t, and replace the unneeded test
with a useful test.

PR: bin/160339
Submitted by: Eugene Grosbein <eugen grosbein.pp.ru>
MFC after: 2 weeks
Approved by: re (kib)
sbin/fsck_ffs/dir.c