Re: [PATCH 1/2] tools/x86/kcpuid: Check last token too

2021-03-16 Thread Feng Tang
On Mon, Mar 15, 2021 at 01:59:00PM +0100, Borislav Petkov wrote: > From: Borislav Petkov > > Input lines like > > 0x801E, 0, EAX, 31:0, Extended APIC ID > > where the short name is missing lead to a segfault because the loop > takes the long name for the short name and tokens[5] bec

[PATCH 1/2] tools/x86/kcpuid: Check last token too

2021-03-15 Thread Borislav Petkov
From: Borislav Petkov Input lines like 0x801E, 0, EAX, 31:0, Extended APIC ID where the short name is missing lead to a segfault because the loop takes the long name for the short name and tokens[5] becomes NULL which explodes later in strcpy(). Check its value too before further p