MCPcopy Create free account
hub / github.com/OISF/libhtp / libhtpFuzzInit

Function libhtpFuzzInit

test/fuzz/fuzz_diff.c:131–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129htp_cfg_t *cfg;
130
131static void libhtpFuzzInit() {
132 logfile = fopen("/dev/null", "w");
133 if (logfile == NULL) {
134 abort();
135 }
136 // Create LibHTP configuration
137 cfg = htp_config_create();
138 if (htp_config_set_server_personality(cfg, HTP_SERVER_IDS) != HTP_OK) {
139 htp_config_destroy(cfg);
140 return;
141 }
142 htp_config_register_log(cfg, HTPCallbackLog);
143 htp_config_register_request_header_data(cfg, HTPCallbackRequestHeaderData);
144 htp_config_register_request_trailer_data(cfg, HTPCallbackRequestHeaderData);
145 htp_config_register_response_header_data(cfg, HTPCallbackResponseHeaderData);
146 htp_config_register_response_trailer_data(cfg, HTPCallbackResponseHeaderData);
147 htp_config_register_request_trailer(cfg, HTPCallbackRequestHasTrailer);
148 htp_config_register_response_trailer(cfg, HTPCallbackResponseHasTrailer);
149 htp_config_register_request_body_data(cfg, HTPCallbackRequestBodyData);
150 htp_config_register_response_body_data(cfg, HTPCallbackResponseBodyData);
151 htp_config_register_request_start(cfg, HTPCallbackRequestStart);
152 htp_config_register_request_complete(cfg, HTPCallbackRequest);
153 htp_config_register_response_start(cfg, HTPCallbackResponseStart);
154 htp_config_register_response_complete(cfg, HTPCallbackResponse);
155 htp_config_register_request_line(cfg, HTPCallbackRequestLine);
156 setenv("srcdir", ".", 1);
157}
158
159static htp_connp_t * libhtpFuzzRun(const uint8_t *Data, size_t Size) {
160 htp_connp_t * connp;

Callers 1

LLVMFuzzerTestOneInputFunction · 0.85

Tested by

no test coverage detected