libxcb/src
Ilya Pominov 038636786a c_client: Fix crash in xcb_randr_set_monitor
Take into account c_need_sizeof when evaluating
xcb_protocol_request_t.count

Incorrect xcb_protocol_request_t.count causes a segmentation fault when
calling functions:
- xcb_randr_set_monitor{_checked}
- xcb_input_change_feedback_control{_checked}
- xcb_input_change_device_control{_unchecked}

Steps to reproduce:
Call xcb_randr_set_monitor() with valid arguments

OBSERVED RESULT
Segmentation fault
```
Process terminating with default action of signal 11 (SIGSEGV)
  Access not within mapped region at address 0x780
    at 0x4852925: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-
amd64-linux.so)
    by 0x486967C: memcpy (string_fortified.h:29)
    by 0x486967C: send_request (xcb_out.c:59)
    by 0x486967C: send_request (xcb_out.c:46)
    by 0x486967C: xcb_send_request_with_fds64 (xcb_out.c:338)
    by 0x48699FC: xcb_send_request (xcb_out.c:359)
    by 0x4891F11: xcb_randr_set_monitor_checked (randr.c:5350)
```

EXPECTED RESULT
Function returns cookie

Amend: 77b594f958

Signed-off-by: Ilya Pominov <ipominov@astralinux.ru>
2023-04-10 20:06:52 +03:00
..
man generated man pages: use xorg footer and no hard coded extension 2014-01-30 12:10:06 +09:00
.gitignore Build DOUBLE-BUFFER extension. 2022-06-02 13:27:48 -04:00
Makefile.am Build DOUBLE-BUFFER extension. 2022-06-02 13:27:48 -04:00
c_client.py c_client: Fix crash in xcb_randr_set_monitor 2023-04-10 20:06:52 +03:00
xcb.h Fix build on Windows 2021-06-04 14:31:13 +00:00
xcb_auth.c Fix a compiler warning 2022-10-16 01:55:30 -04:00
xcb_conn.c xcb_conn: Add a check for NULL to silence a UBSan runtime error 2022-11-26 22:48:00 -08:00
xcb_ext.c Always include "config.h" at the start of all C source files. 2012-08-25 12:34:24 -07:00
xcb_in.c Fix integer overflows in xcb_in.c 2021-11-17 12:09:02 -05:00
xcb_list.c Avoid request counter truncation in replies map after 2**32 requests 2021-09-30 17:22:06 +00:00
xcb_out.c Fix a memory leak 2022-01-15 02:32:04 +09:00
xcb_util.c Add tests for unix socket parsing 2023-03-25 15:27:50 -04:00
xcb_windefs.h Remove tabs and trailing whitespaces 2014-03-21 14:35:16 +01:00
xcb_xid.c Use the 'present' field to properly check that the XC-MISC 2020-03-02 19:01:41 +01:00
xcbext.h Correct @param "e" to "error" in xcb_poll_for_reply*() 2016-05-29 15:56:25 +02:00
xcbint.h Fix hang in xcb_request_check() 2021-09-30 23:32:35 +00:00