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"
23 if (plugin->rdpcontext)
25 free(plugin->rdpcontext);
29WINPR_ATTR_MALLOC(dealloc, 1)
35 rail->rdpcontext = calloc(1,
sizeof(rdpContext));
36 if (!rail->rdpcontext)
40 if (!rail->rdpcontext->settings)
48int LLVMFuzzerTestOneInput(
const uint8_t* data,
size_t size)
52 if (size > (1u << 20))
57 wLog* root = WLog_GetRoot();
58 (void)WLog_SetLogLevel(root, WLOG_TRACE);
59 (void)WLog_SetLogAppenderType(root, WLOG_APPENDER_CALLBACK);
62 RailClientContext* context = (RailClientContext*)calloc(1,
sizeof(RailClientContext));
63 wStream* s = Stream_New(
nullptr, size);
64 if (!g_rail || !context || !s)
67 g_rail->log = WLog_Get(
"fuzz.rail");
71 g_rail->context = context;
72 g_rail->channelEntryPoints.pInterface = context;
76 Stream_Write(s, data, size);
78 if (!Stream_SetPosition(s, 0))
81 (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.