diff options
Diffstat (limited to 'kernel')
-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 4e57732fcfb4..e6101d78edf2 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -595,11 +595,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; |