ACK: [PATCH] utilities: kernelscan: use memmove instead of strcpy

Alex Hung alex.hung at canonical.com
Thu Jul 24 06:48:43 UTC 2014


On 07/15/2014 08:54 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> better to use memmove rather than strcpy; Coverity Scan reports
> that there is a potential overlap with the underlying memory copy
> so use memmove which has the smarts to do this correctly.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/utilities/kernelscan.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/utilities/kernelscan.c b/src/utilities/kernelscan.c
> index 1b793bb..78c70d5 100644
> --- a/src/utilities/kernelscan.c
> +++ b/src/utilities/kernelscan.c
> @@ -741,7 +741,7 @@ static void literal_strip_quotes(token *t)
>
>   	t->token[len-1] = 0;
>
> -	strcpy(t->token, t->token + 1);
> +	memmove(t->token, t->token + 1, len - 1);
>   }
>
>   /*
>


Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list