diff --git a/tools/arch/x86/kcpuid/kcpuid.c b/tools/arch/x86/kcpuid/kcpuid.c index 6048da34fcc6..dae75511fef7 100644 --- a/tools/arch/x86/kcpuid/kcpuid.c +++ b/tools/arch/x86/kcpuid/kcpuid.c @@ -324,6 +324,8 @@ static int parse_line(char *line) str = NULL; } tokens[5] = strtok(str, "\n"); + if (!tokens[5]) + goto err_exit; /* index/main-leaf */ index = strtoull(tokens[0], NULL, 0);