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

Pohjolainen, Topi topi.pohjolainen at intel.com
Thu May 30 00:36:53 PDT 2013


On Tue, May 28, 2013 at 12:08:20PM -0700, Eric Anholt wrote:
> 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.

Thanks for spotting that, it looks that the test passed on blind luck.


More information about the Piglit mailing list