diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index d7af6a3d3c5..02578a3f2df 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c @@ -1383,7 +1383,7 @@ static void deprecated_sysctl_warning(const int *name, int nlen) * CTL_KERN/KERN_VERSION is used by older glibc and cannot * ever go away. */ - if (name[0] == CTL_KERN && name[1] == KERN_VERSION) + if (nlen >= 2 && name[0] == CTL_KERN && name[1] == KERN_VERSION) return; if (printk_ratelimit()) {