[PATCH:makedepend] Bug 56091 - Unsafe use of strcpy() in makedepend

Matthieu Herrb matthieu.herrb at laas.fr
Tue Feb 12 21:42:39 PST 2013


On Tue, Feb 12, 2013 at 06:39:07PM -0800, Alan Coopersmith wrote:
> Use memmove for potentially overlapping copies.
> 
> Reported-by: Laurence Jupp <laurence at narya.org>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Matthieu Herrb <matthieu.herrb at laas.fr>

> ---
>  parse.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/parse.c b/parse.c
> index 2d7c95a..e5240c3 100644
> --- a/parse.c
> +++ b/parse.c
> @@ -229,7 +229,7 @@ deftype (char *line, struct filepointer *filep,
>  		/*
>  		 * copy the definition back to the beginning of the line.
>  		 */
> -		strcpy (line, p);
> +		memmove (line, p, strlen(p) + 1);
>  		break;
>  	case ELSE:
>  	case ENDIF:
> -- 
> 1.7.9.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

-- 
Matthieu Herrb


More information about the xorg-devel mailing list