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>
4 jobs for pr/safe-GetResReq in 10 minutes and 32 seconds (queued for 15 seconds)
Status Name Job ID Coverage
  Prep
passed check-commits #13393426

00:00:38

passed container-prep #13393427

00:02:09

 
  Build
passed build #13393428

00:07:50

 
  Deploy
passed check-merge-request #13393429

00:00:32