diff options
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/params.c b/kernel/params.c index e61c46c97ce7..8e8ca8fac4ff 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -591,11 +591,17 @@ static void __init param_sysfs_builtin(void) for (i=0; i < __stop___param - __start___param; i++) { char *dot; + size_t kplen; kp = &__start___param[i]; + kplen = strlen(kp->name); /* We do not handle args without periods. */ - dot = memchr(kp->name, '.', MAX_KBUILD_MODNAME); + if (kplen > MAX_KBUILD_MODNAME) { + DEBUGP("kernel parameter name is too long: %s\n", kp->name); + continue; + } + dot = memchr(kp->name, '.', kplen); if (!dot) { DEBUGP("couldn't find period in %s\n", kp->name); continue; |