detect: fixes InspectionBuffer id with transforms

When InspectionBufferGet gets called with base_id
Later InspectionBufferSetup must also be called with base_id

In case there were transforms, we had base_id != list_id

Not calling InspectionBufferSetup with the right id
resulted in leaving a dangling pointer,
because it was not added to det_ctx->inspect.to_clear_queue

Bug: #4681.
pull/6620/head
Philippe Antoine 4 years ago committed by Victor Julien
parent 244dd11c34
commit c3339c853e

@ -366,7 +366,7 @@ static InspectionBuffer *HttpServerBodyGetDataCallback(DetectEngineThreadCtx *de
StreamingBufferGetDataAtOffset(body->sb,
&data, &data_len, offset);
InspectionBufferSetup(det_ctx, list_id, buffer, data, data_len);
InspectionBufferSetup(det_ctx, base_id, buffer, data, data_len);
buffer->inspect_offset = offset;
body->body_inspected = body->content_len_so_far;
SCLogDebug("body->body_inspected now: %" PRIu64, body->body_inspected);

@ -284,7 +284,7 @@ static InspectionBuffer *HttpRequestBodyGetDataCallback(DetectEngineThreadCtx *d
StreamingBufferGetDataAtOffset(body->sb,
&data, &data_len, offset);
InspectionBufferSetup(det_ctx, list_id, buffer, data, data_len);
InspectionBufferSetup(det_ctx, base_id, buffer, data, data_len);
buffer->inspect_offset = offset;
body->body_inspected = body->content_len_so_far;
SCLogDebug("body->body_inspected now: %" PRIu64, body->body_inspected);

Loading…
Cancel
Save