[virglrenderer-devel] [PATCH] renderer: check for shader_text validity

Po-Hsien Wang pwang at chromium.org
Tue Jul 31 18:25:04 UTC 2018


ping. Thanks.

On Wed, Jul 25, 2018 at 7:43 PM Po-Hsien Wang <pwang at chromium.org> wrote:

> Add a check for nonterminated string passed into the create_shader
> code.
> ---
>  src/vrend_renderer.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index da24f04..610e796 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -2675,6 +2675,9 @@ int vrend_create_shader(struct vrend_context *ctx,
>     bool finished = false;
>     int ret;
>
> +   if (length <= 0 || shd_text[length - 1] != '\0')
> +      return EINVAL;
> +
>     if (type > PIPE_SHADER_TESS_EVAL)
>        return EINVAL;
>
> --
> 2.18.0.345.g5c9ce644c3-goog
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/virglrenderer-devel/attachments/20180731/b681d933/attachment.html>


More information about the virglrenderer-devel mailing list