diff options
-rw-r--r-- | sys/boot/common/module.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c index ae93426..adeb1b8 100644 --- a/sys/boot/common/module.c +++ b/sys/boot/common/module.c @@ -864,7 +864,8 @@ moduledir_readhints(struct moduledir *mdp) if (mdp->d_hints != NULL || (mdp->d_flags & MDIR_NOHINTS)) return; path = moduledir_fullpath(mdp, "linker.hints"); - if (stat(path, &st) != 0 || st.st_size < (sizeof(version) + sizeof(int)) || + if (stat(path, &st) != 0 || + st.st_size < (ssize_t)(sizeof(version) + sizeof(int)) || st.st_size > 100 * 1024 || (fd = open(path, O_RDONLY)) < 0) { free(path); mdp->d_flags |= MDIR_NOHINTS; |