GLX: fix out-of-bounds memory issue in indirect glAreTexturesResident()
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 21:27:42 +0000 (14:27 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 21:27:42 +0000 (14:27 -0700)
commit13f96c5401ffe3869f08fecb2baf5bff2438b02e
treea7b3e9c73b980cb9cb744d656c918eea69a3f66b
parent6186e7a20676c5df30b1b4bffeec87afa1550e25
GLX: fix out-of-bounds memory issue in indirect glAreTexturesResident()

See bug 18445.
When getting array results, __glXReadReply() always reads a multiple of
four bytes.  This can cause writing to invalid memory when 'n' is not a
multiple of four.

Special-case the glAreTexturesResident() functions now.
To fix the bug, we use a temporary buffer that's a multiple of four bytes
in length.

NOTE: this commit also reverts part of commit 919ec22ecf72aa163e1b97d8c7381002131ed32c
(glx/x11: Added some #ifdef GLX_DIRECT_RENDERING protection) which
directly edited the indirect.c file rather than the python generator!
I'm not repairing that issue at this time.
src/glx/x11/indirect.c
src/glx/x11/single2.c
src/mesa/drivers/dri/common/extension_helper.h
src/mesa/glapi/dispatch.h
src/mesa/glapi/gl_API.xml
src/mesa/main/enums.c