renderer: check for shader_text validity

Add a check for nonterminated string passed into the create_shader
code.

No point checking len <= 0, since it's a uint32_t.

Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Po-Hsien Wang 7 years ago committed by Dave Airlie
parent fae89caf15
commit 3193c2cbab
  1. 3
      src/vrend_renderer.c

@ -2929,6 +2929,9 @@ int vrend_create_shader(struct vrend_context *ctx,
bool finished = false;
int ret;
if (pkt_length == 0 || shd_text[pkt_length - 1] != '\0')
return EINVAL;
if (type > PIPE_SHADER_COMPUTE)
return EINVAL;

Loading…
Cancel
Save