Page MenuHomeFreeBSD

D15957.diff
No OneTemporary

D15957.diff

Index: lib/libc/gen/opendir.c
===================================================================
--- lib/libc/gen/opendir.c
+++ lib/libc/gen/opendir.c
@@ -218,7 +218,8 @@
struct dirent *dp;
dp = (struct dirent *) ddptr;
- if ((long)dp & 03L)
+ /* dirent should be 8-byte aligned. */
+ if (((uintptr_t)dp & 0x7) != 0)
break;
if ((dp->d_reclen <= 0) ||
(dp->d_reclen > (ddeptr + 1 - ddptr)))
Index: lib/libc/gen/readdir.c
===================================================================
--- lib/libc/gen/readdir.c
+++ lib/libc/gen/readdir.c
@@ -76,7 +76,8 @@
}
dirp->dd_flags &= ~__DTF_SKIPREAD;
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
- if ((long)dp & 03L) /* bogus pointer check */
+ /* dirent should be 8-byte aligned. */
+ if (((uintptr_t)dp & 0x7) != 0)
return (NULL);
if (dp->d_reclen <= 0 ||
dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc)

File Metadata

Mime Type
text/plain
Expires
Mon, Jun 8, 11:58 PM (20 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33821570
Default Alt Text
D15957.diff (921 B)

Event Timeline