10#include <winpr/stream.h>
11#include <winpr/wlog.h>
13#include <freerdp/client/rail.h>
14#include <freerdp/freerdp.h>
16#include "../rail_main.h"
17#include "../rail_orders.h"
24 free(plugin->rdpcontext);
28WINPR_ATTR_MALLOC(dealloc, 1)
34 rail->rdpcontext = calloc(1,
sizeof(rdpContext));
35 if (!rail->rdpcontext)
39 if (!rail->rdpcontext->settings)
47int LLVMFuzzerTestOneInput(
const uint8_t* data,
size_t size)
51 if (size > (1u << 20))
56 wLog* root = WLog_GetRoot();
57 (void)WLog_SetLogLevel(root, WLOG_TRACE);
58 (void)WLog_SetLogAppenderType(root, WLOG_APPENDER_CALLBACK);
61 RailClientContext* context = (RailClientContext*)calloc(1,
sizeof(RailClientContext));
62 wStream* s = Stream_New(
nullptr, size);
63 if (!g_rail || !context || !s)
66 g_rail->log = WLog_Get(
"fuzz.rail");
70 g_rail->context = context;
71 g_rail->channelEntryPoints.pInterface = context;
75 Stream_Write(s, data, size);
77 if (!Stream_SetPosition(s, 0))
80 (void)rail_order_recv(g_rail, s);
FREERDP_API rdpSettings * freerdp_settings_new(DWORD flags)
creates a new setting struct
FREERDP_API void freerdp_settings_free(rdpSettings *settings)
Free a settings struct with all data in it.