[Piglit] [PATCH] GL_ARB_ubo/maxblocks: fix writing to zero-length string

Eric Anholt eric at anholt.net
Thu Aug 2 10:06:49 PDT 2012


Brian Paul <brianp at vmware.com> writes:

> When get_shader() was called with blocks=0 we were allocating string
> buffers of length zero.  Assigning prefix[0] = 0 caused an invalid
> memory write (found w/ valgrind).  Adding one to the calloc() length
> fixes this.

Oops.  With all the patches I've got outstanding, I hadn't sent this one
out.

Reviewed-by: Eric Anholt <eric at anholt.net>

> But compiling a shader string of length=0 seems a little strange...

It's not compiling a shader string of that length, it's compiling a
template shader string with extra contents of length 0 added.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120802/a9b726f4/attachment.pgp>


More information about the Piglit mailing list