[Piglit] [v7 06/12] tests: spec: EXT_image_dma_buf_import missing attributes

Eric Anholt eric at anholt.net
Tue May 28 12:08:20 PDT 2013


Topi Pohjolainen <topi.pohjolainen at intel.com> writes:
> +static void
> +fill_one_missing(const EGLint *all, EGLint *out, EGLint missing)
> +{
> +	unsigned i;
> +
> +	for (i = 0; i < NUM_MANDATORY_ATTRS; ++i) {
> +		if (all[2 * i] != missing) {
> +			out[2 * i + 0] = all[2 * i + 0];
> +			out[2 * i + 1] = all[2 * i + 1];
> +		}
> +	}
> +
> +	out[i] = EGL_NONE;

I think you meant to pack things into out[] with the missing attribute
skipped.  As is, it looks like you overflow the out[] buffer on the
stack in the caller, and there's a hole in the middle with undefined
data passed in.
-------------- 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/20130528/7caac616/attachment.pgp>


More information about the Piglit mailing list