http: htp_table_get_index does not return NULL

if the index is correct
pull/9001/head
Philippe Antoine 2 years ago committed by Victor Julien
parent 415b036dca
commit 14ecfebf68

@ -91,9 +91,7 @@ void HTTP2MimicHttp1Request(void *alstate_orig, void *h2s)
size_t nbheaders = htp_table_size(h1tx->request_headers);
for (size_t i = 0; i < nbheaders; i++) {
htp_header_t *h = htp_table_get_index(h1tx->request_headers, i, NULL);
if (h != NULL) {
rs_http2_tx_add_header(h2s, bstr_ptr(h->name), bstr_len(h->name), bstr_ptr(h->value),
bstr_len(h->value));
}
rs_http2_tx_add_header(
h2s, bstr_ptr(h->name), bstr_len(h->name), bstr_ptr(h->value), bstr_len(h->value));
}
}

@ -321,10 +321,7 @@ static void EveHttpLogJSONHeaders(
bool array_empty = true;
jb_open_array(js, direction & LOG_HTTP_REQ_HEADERS ? "request_headers" : "response_headers");
for (size_t i = 0; i < n; i++) {
htp_header_t * h = htp_table_get_index(headers, i, NULL);
if (h == NULL) {
continue;
}
htp_header_t *h = htp_table_get_index(headers, i, NULL);
if ((http_ctx->flags & direction) == 0 && http_ctx->fields != 0) {
bool tolog = false;
for (HttpField f = HTTP_FIELD_ACCEPT; f < HTTP_FIELD_SIZE; f++) {

Loading…
Cancel
Save