ACK: [PATCH] lib: fwts_cpu: The string "flags" is 5 chars, fix incorrect strncmp size
ivanhu
ivan.hu at canonical.com
Fri Apr 21 02:48:19 UTC 2017
On 04/13/2017 06:16 PM, Colin King wrote:
> From: Colin Ian King <colin.king at 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 at 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 at canonical.com>
More information about the fwts-devel
mailing list