mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-05 15:48:02 +02:00
libX11: do not crash in GetResReq() macro
When _XGetRequest() detects that requested length exceeds remaining display output buffer capacity it would return NULL. GetResReq() macro obtains "req" pointer from a call to _XGetRequest() and then proceeds to assign request id through "req" pointer which leads to NULL pointer dereference in this case. Fix this by checking if "req" is valid before assigning request id. Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
This commit is contained in:
parent
e92efc63ac
commit
2356e59ff2
1 changed files with 1 additions and 1 deletions
|
|
@ -559,7 +559,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
|
|||
|
||||
#define GetResReq(name, rid, req) \
|
||||
req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \
|
||||
req->id = (rid)
|
||||
if (req) req->id = (rid)
|
||||
|
||||
/*
|
||||
* GetEmptyReq is for those requests that have no arguments
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue