[][src]Function http_desync_guardian::http_desync_guardian_analyze_request

#[no_mangle]pub extern "C" fn http_desync_guardian_analyze_request(
    request: Option<&mut ExtHttpRequestData>,
    verdict: Option<&mut ClassificationVerdict>
)

Analyzes a given HTTP request.

Arguments

  • request a pointer to request
  • verdict a pointer to verdict placeholder (being populated by this method) Both arguments are being changed during execution of this method.

Safety

As long as request is well-formed and verdict is a valid pointer. Which means no NULLs are allowed for names or values. Pass an empty string instead: Also headers must be fully initialized, e.g.

#define http_desync_guardian_string(str) { .length = sizeof(str) - 1, .data_ptr = (uint8_t *) (str) }

guardian_header = {
   .name = http_desync_guardian_string("Connection"),
   .value = http_desync_guardian_string(" keep-alive"),
},

Note

This method may abort execution, if any parameter is invalid. Which includes:

  1. Any input is NULL
  2. Header count > 0, but the pointer is NULL
  3. Any string has > 0 length, but the pointer is NULL