Message ID | 20170413101655.13603-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2017-04-13 03:16 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Currently this string is being compared with a strncmp of size 4 bytes > instead of the correct string size of 5 bytes. Fix this. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_cpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c > index 148857e4..90bae200 100644 > --- a/src/lib/src/fwts_cpu.c > +++ b/src/lib/src/fwts_cpu.c > @@ -160,7 +160,7 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu) > sscanf(ptr, "%d", &cpu->stepping); > continue; > } > - if (!strncmp(buffer, "flags", 4)) { > + if (!strncmp(buffer, "flags", 5)) { > cpu->flags = strdup(ptr); > continue; > } > Acked-by: Alex Hung <alex.hung@canonical.com>
On 04/13/2017 06:16 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Currently this string is being compared with a strncmp of size 4 bytes > instead of the correct string size of 5 bytes. Fix this. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_cpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c > index 148857e4..90bae200 100644 > --- a/src/lib/src/fwts_cpu.c > +++ b/src/lib/src/fwts_cpu.c > @@ -160,7 +160,7 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu) > sscanf(ptr, "%d", &cpu->stepping); > continue; > } > - if (!strncmp(buffer, "flags", 4)) { > + if (!strncmp(buffer, "flags", 5)) { > cpu->flags = strdup(ptr); > continue; > } > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c index 148857e4..90bae200 100644 --- a/src/lib/src/fwts_cpu.c +++ b/src/lib/src/fwts_cpu.c @@ -160,7 +160,7 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu) sscanf(ptr, "%d", &cpu->stepping); continue; } - if (!strncmp(buffer, "flags", 4)) { + if (!strncmp(buffer, "flags", 5)) { cpu->flags = strdup(ptr); continue; }