[Beignet] [PATCH 1/2] fix global variable out of boundary writing in libocl.
Zhigang Gong
zhigang.gong at linux.intel.com
Sun Jun 14 19:18:24 PDT 2015
Nice catch, LGTM, thanks.
On Fri, Jun 12, 2015 at 09:10:00AM +0800, xionghu.luo at intel.com wrote:
> From: Luo Xionghu <xionghu.luo at intel.com>
>
> need minus one when fill '\0' to sizeof char type array.
>
> Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
> ---
> src/cl_extensions.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/cl_extensions.c b/src/cl_extensions.c
> index adcf82e..6b82b96 100644
> --- a/src/cl_extensions.c
> +++ b/src/cl_extensions.c
> @@ -69,7 +69,7 @@ process_extension_str(cl_extensions_t *extensions)
> int str_offset = 0;
> int id;
>
> - extensions->ext_str[str_max] = '\0';
> + extensions->ext_str[str_max-1] = '\0';
>
> for(id = 0; id < cl_khr_extension_id_max; id++)
> {
> --
> 1.9.1
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list