[Beignet] [PATCH] Runtime: fix a string overflow.

Song, Ruiling ruiling.song at intel.com
Mon Jul 25 02:23:35 UTC 2016


LGTM

Thanks!
Ruiling

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Yang Rong
> Sent: Monday, July 18, 2016 12:45 PM
> To: beignet at lists.freedesktop.org
> Cc: Yang, Rong R <rong.r.yang at intel.com>
> Subject: [Beignet] [PATCH] Runtime: fix a string overflow.
> 
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
>  src/cl_program.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/cl_program.c b/src/cl_program.c
> index 644856c..17f64ca 100644
> --- a/src/cl_program.c
> +++ b/src/cl_program.c
> @@ -965,7 +965,7 @@ cl_program_get_kernel_names(cl_program p, size_t
> size, char *names, size_t *size
>    len = strlen(ker_name);
>    if(names) {
>      strncpy(names, cl_kernel_get_name(p->ker[0]), size - 1);
> -    names[size] = '\0';
> +    names[size - 1] = '\0';
>      if(size < len - 1) {
>        if(size_ret) *size_ret = size;
>        return;
> --
> 2.1.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list