Project: freerdp (freerdp/freerdp), language: c++
Vulnerability instance: freerdp.cve-2023-40186
Sanitizer: address

================= Bug Report (1/1) ==================
## Source: GitHub Advisory
## URL: https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-hcj4-3c3r-5j3v
## Description:
Advisory ID: GHSA-hcj4-3c3r-5j3v
Title: IntegerOverflow leading to Out-Of-Bound Write Vulnerability in gdi_CreateSurface

Description:
Summary
IntegerOverflow leading to Out-Of-Bound Write Vulnerability in gdi_CreateSurface
Affected
FreeRDP based clients only. FreeRDP proxy not affected as image decoding is not done by proxy (data passthrough)
Details
FreeRDP/libfreerdp/gdi/gfx.c
Lines 1156 to 1165 in fee2b10
 surface->scanline = gfx_align_scanline(surface->width * 4UL, 16); 
 surface->data = (BYTE*)winpr_aligned_malloc(surface->scanline * surface->height * 1ULL, 16); 
    if (!surface->data) 
 { 
  free(surface); 
  goto fail; 
 } 
    memset(surface->data, 0xFF, (size_t)surface->scanline * surface->height); 
PoC
Set surface->width == 0xFFF0, surface->height == 0xFFF0
After gfx_align_scanline surface->scanline is 0x3ffc0, surface->height is 0xfff0
surface->scanline is UINT32, surface->scanline * surface->height is 0xff800400
size argument of memset is (size_t)surface->scanline * surface->height, so 0x3ff800400 crashed
Impact
Out-Of-Bound Write Vulnerability
Patch Suggestion
surface->data = (BYTE*)winpr_aligned_malloc((size_t)surface->scanline * surface->height, 16);
Asan
==48657==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x00037f804c28 at pc 0x0001032ffa40 bp 0x00016f0cda10 sp 0x00016f0cd1d0
WRITE of size 17171481600 at 0x00037f804c28 thread T4
    #0 0x1032ffa3c in __asan_memset+0x1f4 (libclang_rt.asan_osx_dynamic.dylib:arm64+0x4fa3c) (BuildId: 4947f3677e4435f39b5765e7dbc19bf732000000200000000100000000000b00)
    #1 0x102364034 in gdi_CreateSurface+0xb8c (libfreerdp3.3.0.0.dylib:arm64+0x158034) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #2 0x1015341a0 in rdpgfx_recv_create_surface_pdu+0x90c (libfreerdp-client3.3.0.0.dylib:arm64+0x981a0) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #3 0x10152c668 in rdpgfx_recv_pdu+0xa84 (libfreerdp-client3.3.0.0.dylib:arm64+0x90668) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #4 0x10152b13c in rdpgfx_on_data_received+0x444 (libfreerdp-client3.3.0.0.dylib:arm64+0x8f13c) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #5 0x1014ae630 in dvcman_call_on_receive+0x164 (libfreerdp-client3.3.0.0.dylib:arm64+0x12630) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #6 0x1014ae49c in dvcman_receive_channel_data+0x440 (libfreerdp-client3.3.0.0.dylib:arm64+0x1249c) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #7 0x1014aae84 in drdynvc_process_data+0x2c8 (libfreerdp-client3.3.0.0.dylib:arm64+0xee84) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #8 0x1014a90f8 in drdynvc_order_recv+0x334 (libfreerdp-client3.3.0.0.dylib:arm64+0xd0f8) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #9 0x1014a8b3c in drdynvc_virtual_channel_event_data_received+0x498 (libfreerdp-client3.3.0.0.dylib:arm64+0xcb3c) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #10 0x1014a7824 in drdynvc_virtual_channel_open_event_ex+0x1ac (libfreerdp-client3.3.0.0.dylib:arm64+0xb824) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #11 0x10246479c in freerdp_channels_data+0x5cc (libfreerdp3.3.0.0.dylib:arm64+0x25879c) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #12 0x102516050 in freerdp_channel_process+0x6e0 (libfreerdp3.3.0.0.dylib:arm64+0x30a050) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #13 0x1024c63b0 in rdp_recv_tpkt_pdu+0x11e8 (libfreerdp3.3.0.0.dylib:arm64+0x2ba3b0) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #14 0x1024c5170 in rdp_recv_pdu+0x34 (libfreerdp3.3.0.0.dylib:arm64+0x2b9170) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #15 0x1024c09d8 in rdp_recv_callback_int+0x1408 (libfreerdp3.3.0.0.dylib:arm64+0x2b49d8) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #16 0x1024bf500 in rdp_recv_callback+0x1d8 (libfreerdp3.3.0.0.dylib:arm64+0x2b3500) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #17 0x1024e5cb4 in transport_check_fds+0x51c (libfreerdp3.3.0.0.dylib:arm64+0x2d9cb4) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #18 0x1024c12e0 in rdp_check_fds+0x170 (libfreerdp3.3.0.0.dylib:arm64+0x2b52e0) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #19 0x10245bf58 in freerdp_check_fds+0x1ac (libfreerdp3.3.0.0.dylib:arm64+0x24ff58) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #20 0x10245c628 in freerdp_check_event_handles+0x70 (libfreerdp3.3.0.0.dylib:arm64+0x250628) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #21 0x1010bf700 in mac_client_thread+0x5a4 (MacFreeRDP:arm64+0x13700) (BuildId: 648033a131eb3f0f9702f5da3e9b172432000000200000000100000000000d00)
    #22 0x102d78668 in thread_launcher thread.c:520
    #23 0x18c437fa4 in _pthread_start+0x90 (libsystem_pthread.dylib:arm64+0x6fa4) (BuildId: 46d35233a0513f4fbba4ba56dddc4d1a32000000200000000100000000040d00)
    #24 0x790800018c432d9c  (<unknown module>)

0x00037f804c28 is located 0 bytes after 4286579752-byte region [0x000280004800,0x00037f804c28)
allocated by thread T4 here:
    #0 0x1033015b0 in wrap_malloc+0x8c (libclang_rt.asan_osx_dynamic.dylib:arm64+0x515b0) (BuildId: 4947f3677e4435f39b5765e7dbc19bf732000000200000000100000000000b00)
    #1 0x102dd8418 in winpr_aligned_offset_malloc alignment.c:123
    #2 0x102dd7fac in winpr_aligned_malloc alignment.c:60
    #3 0x102363e8c in gdi_CreateSurface+0x9e4 (libfreerdp3.3.0.0.dylib:arm64+0x157e8c) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #4 0x1015341a0 in rdpgfx_recv_create_surface_pdu+0x90c (libfreerdp-client3.3.0.0.dylib:arm64+0x981a0) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #5 0x10152c668 in rdpgfx_recv_pdu+0xa84 (libfreerdp-client3.3.0.0.dylib:arm64+0x90668) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #6 0x10152b13c in rdpgfx_on_data_received+0x444 (libfreerdp-client3.3.0.0.dylib:arm64+0x8f13c) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #7 0x1014ae630 in dvcman_call_on_receive+0x164 (libfreerdp-client3.3.0.0.dylib:arm64+0x12630) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #8 0x1014ae49c in dvcman_receive_channel_data+0x440 (libfreerdp-client3.3.0.0.dylib:arm64+0x1249c) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #9 0x1014aae84 in drdynvc_process_data+0x2c8 (libfreerdp-client3.3.0.0.dylib:arm64+0xee84) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #10 0x1014a90f8 in drdynvc_order_recv+0x334 (libfreerdp-client3.3.0.0.dylib:arm64+0xd0f8) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #11 0x1014a8b3c in drdynvc_virtual_channel_event_data_received+0x498 (libfreerdp-client3.3.0.0.dylib:arm64+0xcb3c) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #12 0x1014a7824 in drdynvc_virtual_channel_open_event_ex+0x1ac (libfreerdp-client3.3.0.0.dylib:arm64+0xb824) (BuildId: b64f59196b7c338a835a3b51ef8c4a7d32000000200000000100000000000d00)
    #13 0x10246479c in freerdp_channels_data+0x5cc (libfreerdp3.3.0.0.dylib:arm64+0x25879c) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #14 0x102516050 in freerdp_channel_process+0x6e0 (libfreerdp3.3.0.0.dylib:arm64+0x30a050) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #15 0x1024c63b0 in rdp_recv_tpkt_pdu+0x11e8 (libfreerdp3.3.0.0.dylib:arm64+0x2ba3b0) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #16 0x1024c5170 in rdp_recv_pdu+0x34 (libfreerdp3.3.0.0.dylib:arm64+0x2b9170) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #17 0x1024c09d8 in rdp_recv_callback_int+0x1408 (libfreerdp3.3.0.0.dylib:arm64+0x2b49d8) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #18 0x1024bf500 in rdp_recv_callback+0x1d8 (libfreerdp3.3.0.0.dylib:arm64+0x2b3500) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #19 0x1024e5cb4 in transport_check_fds+0x51c (libfreerdp3.3.0.0.dylib:arm64+0x2d9cb4) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #20 0x1024c12e0 in rdp_check_fds+0x170 (libfreerdp3.3.0.0.dylib:arm64+0x2b52e0) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #21 0x10245bf58 in freerdp_check_fds+0x1ac (libfreerdp3.3.0.0.dylib:arm64+0x24ff58) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #22 0x10245c628 in freerdp_check_event_handles+0x70 (libfreerdp3.3.0.0.dylib:arm64+0x250628) (BuildId: f272e93b6b143d7daa257484a303935632000000200000000100000000000d00)
    #23 0x1010bf700 in mac_client_thread+0x5a4 (MacFreeRDP:arm64+0x13700) (BuildId: 648033a131eb3f0f9702f5da3e9b172432000000200000000100000000000d00)
    #24 0x102d78668 in thread_launcher thread.c:520
    #25 0x18c437fa4 in _pthread_start+0x90 (libsystem_pthread.dylib:arm64+0x6fa4) (BuildId: 46d35233a0513f4fbba4ba56dddc4d1a32000000200000000100000000040d00)
    #26 0x790800018c432d9c  (<unknown module>)

Thread T4 created by T0 here:
    #0 0x1032fa91c in wrap_pthread_create+0x50 (libclang_rt.asan_osx_dynamic.dylib:arm64+0x4a91c) (BuildId: 4947f3677e4435f39b5765e7dbc19bf732000000200000000100000000000b00)
    #1 0x102d756e8 in winpr_StartThread thread.c:568
    #2 0x102d74dbc in CreateThread thread.c:650
    #3 0x1010bee64 in -[MRDPView rdpStart:]+0x964 (MacFreeRDP:arm64+0x12e64) (BuildId: 648033a131eb3f0f9702f5da3e9b172432000000200000000100000000000d00)
    #4 0x1010be2b4 in mfreerdp_client_start+0x488 (MacFreeRDP:arm64+0x122b4) (BuildId: 648033a131eb3f0f9702f5da3e9b172432000000200000000100000000000d00)
    #5 0x1010b218c in freerdp_client_start+0x190 (MacFreeRDP:arm64+0x618c) (BuildId: 648033a131eb3f0f9702f5da3e9b172432000000200000000100000000000d00)
    #6 0x100fee78c in -[AppDelegate applicationDidFinishLaunching:]+0x53c (MacFreeRDP:arm64+0x10000678c) (BuildId: c0debf5af29834acb3c97ff2be5d5c4932000000200000000100000000000d00)
    #7 0x18c50b17c in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__+0x90 (CoreFoundation:arm64+0x7417c) (BuildId: 203e44018c2e3157a24b92f52551d43e32000000200000000100000000040d00)
    #8 0xac4e00018c5a6ee8  (<unknown module>)
    #9 0x2e0780018c5a6e30  (<unknown module>)
    #10 0xf61a00018c4dc4c8  (<unknown module>)
    #11 0xcf1980018d43a8f0  (<unknown module>)
    #12 0xba4780018f73d154  (<unknown module>)
    #13 0x893f80018f73cf04  (<unknown module>)
    #14 0xf94a00018f73afa0  (<unknown module>)
    #15 0x963380018f73ab9c  (<unknown module>)
    #16 0x2d2780018d464b60  (<unknown module>)
    #17 0xd6300018d4649c0  (<unknown module>)
    #18 0xb61400019283d514  (<unknown module>)
    #19 0x397480019283ce40  (<unknown module>)
    #20 0xfe05800192835f14  (<unknown module>)
    #21 0x2567000195d6eb40  (<unknown module>)
    #22 0x977780018f736044  (<unknown module>)
    #23 0x574a00018f734edc  (<unknown module>)
    #24 0xe91180018f729340  (<unknown module>)
    #25 0x142b00018f700790  (<unknown module>)
    #26 0x654e000100fee020  (<unknown module>)
    #27 0x18c0dff24  (<unknown module>)
    #28 0x842dfffffffffffc  (<unknown module>)

SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:arm64+0x4fa3c) (BuildId: 4947f3677e4435f39b5765e7dbc19bf732000000200000000100000000000b00) in __asan_memset+0x1f4
Shadow bytes around the buggy address:
  0x00037f804980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00037f804a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00037f804a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00037f804b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00037f804b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x00037f804c00: 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa
  0x00037f804c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x00037f804d00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x00037f804d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x00037f804e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x00037f804e80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==48657==ABORTING
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [fatal_handler]: Caught signal 'Abort trap: 6' [6]
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 0: 0   libwinpr3.3.0.0.dylib               0x0000000102cd68a0 winpr_execinfo_backtrace + 336
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 1: 1   libwinpr3.3.0.0.dylib               0x0000000102cd03d8 winpr_backtrace + 24
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 2: 2   libwinpr3.3.0.0.dylib               0x0000000102cd0734 winpr_log_backtrace_ex + 304
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 3: 3   libwinpr3.3.0.0.dylib               0x0000000102cd05f8 winpr_log_backtrace + 44
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 4: 4   libfreerdp3.3.0.0.dylib             0x00000001022cbbe8 fatal_handler + 460
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 5: 5   libsystem_platform.dylib            0x000000018c466a24 _sigtramp + 56
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 6: 6   libsystem_pthread.dylib             0x000000018c437c28 pthread_kill + 288
[22:01:44:73] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 7: 7   libsystem_c.dylib                   0x000000018c345ae8 abort + 180
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 8: 8   libclang_rt.asan_osx_dynamic.dylib  0x00000001033249b8 _ZN11__sanitizer6AtexitEPFvvE + 0
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 9: 9   libclang_rt.asan_osx_dynamic.dylib  0x0000000103324124 _ZN11__sanitizer22SetCheckUnwindCallbackEPFvvE + 0
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 10: 10  libclang_rt.asan_osx_dynamic.dylib  0x0000000103309658 _ZN6__asan16ErrorDescription5PrintEv + 0
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 11: 11  libclang_rt.asan_osx_dynamic.dylib  0x000000010330899c _ZN6__asan18ReportGenericErrorEmmmmbmjb + 1452
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 12: 12  libclang_rt.asan_osx_dynamic.dylib  0x00000001032ffa60 __asan_memset + 536
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 13: 13  libfreerdp3.3.0.0.dylib             0x0000000102364038 gdi_CreateSurface + 2960
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 14: 14  libfreerdp-client3.3.0.0.dylib      0x00000001015341a4 rdpgfx_recv_create_surface_pdu + 2320
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 15: 15  libfreerdp-client3.3.0.0.dylib      0x000000010152c66c rdpgfx_recv_pdu + 2696
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 16: 16  libfreerdp-client3.3.0.0.dylib      0x000000010152b140 rdpgfx_on_data_received + 1096
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 17: 17  libfreerdp-client3.3.0.0.dylib      0x00000001014ae634 dvcman_call_on_receive + 360
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 18: 18  libfreerdp-client3.3.0.0.dylib      0x00000001014ae4a0 dvcman_receive_channel_data + 1092
[22:01:44:74] [48657:6f0cf000] [ERROR][com.freerdp.utils.signal] - [winpr_log_backtrace_ex]: 19: 19  libfreerdp-client3.3.0.0.dylib      0x00000001014aae88 drdynvc_process_data + 716


References:
https://github.com/FreeRDP/FreeRDP/blob/fee2b10ba1154f952769a53eb608f044782e22f8/libfreerdp/gdi/gfx.c#L1156-L1165
https://github.com/FreeRDP/FreeRDP/commit/fee2b10ba1154f952769a53eb608f044782e22f8

Build script:
#!/bin/bash -eu
# Minimized build script with only core build commands
set -eu
    -DCMAKE_C_FLAGS="${CFLAGS}"
    -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
    -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
    -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}"
    -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}"
cmake "${cmake_args[@]}" -S . -B build -G Ninja
cmake --build build --parallel --target fuzzers

Dockerfile:
FROM hwiwonlee/secb.base:latest
RUN apt-get update && apt-get install -y build-essential git-core cmake ninja-build pkg-config zlib1g-dev ccache libx11-dev libxext-dev libxinerama-dev libxcursor-dev libxkbfile-dev libxv-dev libxi-dev libxdamage-dev libxrender-dev libxrandr-dev libssl-dev libasound2-dev libcups2-dev libpulse-dev libcairo2-dev libavutil-dev libavcodec-dev libusb-1.0-0-dev libicu-dev libpkcs11-helper1-dev libpkcs11-helper1 libsdl2-ttf-dev libwayland-dev libpam0g-dev libxcb-damage0-dev ccache libxtst-dev libfuse-dev libsystemd-dev libsoxr-dev libsdl2-dev docbook-xsl libkrb5-dev krb5-multidev libcjson-dev libswscale-dev libswresample-dev libpcsclite-dev xsltproc libsdl2-dev
RUN git clone https://github.com/freerdp/freerdp freerdp
RUN git -C freerdp checkout 16047bd16f159ee4aea581854170e83c36862793
WORKDIR $SRC/freerdp
COPY build.sh $SRC/

Additional files: