FreeRDP
Loading...
Searching...
No Matches
TestFuzzSmartcardOperations.c
1#include <winpr/stream.h>
2#include <freerdp/channels/scard.h>
3#include <freerdp/utils/smartcard_operations.h>
4
5int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
6{
7 SMARTCARD_OPERATION operation = WINPR_C_ARRAY_INIT;
8 wStream sbuffer = WINPR_C_ARRAY_INIT;
9
10 wStream* s = Stream_StaticConstInit(&sbuffer, Data, Size);
11 if (!s)
12 return 0;
13
14 /* Decodes the Device Control Request header, then dispatches on the
15 * IoControlCode into the matching smartcard_unpack_*_call(). */
16 (void)smartcard_irp_device_control_decode_request(s, 1, 0, &operation);
17 smartcard_operation_free(&operation, FALSE);
18
19 return 0;
20}