summaryrefslogtreecommitdiff
path: root/glx/unpack.h
diff options
context:
space:
mode:
Diffstat (limited to 'glx/unpack.h')
-rw-r--r--glx/unpack.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/glx/unpack.h b/glx/unpack.h
index 52fba74e1..2b1ebcf02 100644
--- a/glx/unpack.h
+++ b/glx/unpack.h
@@ -83,7 +83,8 @@ extern xGLXSingleReply __glXReply;
** pointer.
*/
#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
- if ((size) > sizeof(answerBuffer)) { \
+ if (size < 0) return BadLength; \
+ else if ((size) > sizeof(answerBuffer)) { \
int bump; \
if ((cl)->returnBufSize < (size)+(align)) { \
(cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \