summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
51c4d8f)
SCCS-vsn: sys/kern/vfs_lookup.c 6.25
SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 6.25
SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 6.25
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)vfs_lookup.c 6.24 (Berkeley) %G%
+ * @(#)vfs_lookup.c 6.25 (Berkeley) %G%
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
for (off = 0; off < ip->i_size; off += dp->d_reclen) {
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
for (off = 0; off < ip->i_size; off += dp->d_reclen) {
- if (dp->d_reclen <= 0)
- return (0);
error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
off, 1, &count);
/*
error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
off, 1, &count);
/*
*/
if (error || count != 0)
return (0);
*/
if (error || count != 0)
return (0);
+ /* avoid infinite loops */
+ if (dp->d_reclen <= 0)
+ return (0);
/* skip empty entries */
if (dp->d_ino == 0)
continue;
/* skip empty entries */
if (dp->d_ino == 0)
continue;
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)ufs_lookup.c 6.24 (Berkeley) %G%
+ * @(#)ufs_lookup.c 6.25 (Berkeley) %G%
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
for (off = 0; off < ip->i_size; off += dp->d_reclen) {
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
for (off = 0; off < ip->i_size; off += dp->d_reclen) {
- if (dp->d_reclen <= 0)
- return (0);
error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
off, 1, &count);
/*
error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
off, 1, &count);
/*
*/
if (error || count != 0)
return (0);
*/
if (error || count != 0)
return (0);
+ /* avoid infinite loops */
+ if (dp->d_reclen <= 0)
+ return (0);
/* skip empty entries */
if (dp->d_ino == 0)
continue;
/* skip empty entries */
if (dp->d_ino == 0)
continue;
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)ufs_lookup.c 6.24 (Berkeley) %G%
+ * @(#)ufs_lookup.c 6.25 (Berkeley) %G%
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
for (off = 0; off < ip->i_size; off += dp->d_reclen) {
#define MINDIRSIZ (sizeof (struct dirtemplate) / 2)
for (off = 0; off < ip->i_size; off += dp->d_reclen) {
- if (dp->d_reclen <= 0)
- return (0);
error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
off, 1, &count);
/*
error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
off, 1, &count);
/*
*/
if (error || count != 0)
return (0);
*/
if (error || count != 0)
return (0);
+ /* avoid infinite loops */
+ if (dp->d_reclen <= 0)
+ return (0);
/* skip empty entries */
if (dp->d_ino == 0)
continue;
/* skip empty entries */
if (dp->d_ino == 0)
continue;