From: Victor Julien Date: Sat, 28 Jan 2023 10:26:46 +0000 (+0100) Subject: detect/ike.vendor: update buffer initialization logic X-Git-Tag: suricata-7.0.0-rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=849f1cf1b84bc889d30b6b227823640630f6e748;p=thirdparty%2Fsuricata.git detect/ike.vendor: update buffer initialization logic --- diff --git a/src/detect-ike-vendor.c b/src/detect-ike-vendor.c index 4c4be8f1a9..c0d57de346 100644 --- a/src/detect-ike-vendor.c +++ b/src/detect-ike-vendor.c @@ -56,7 +56,7 @@ static int g_ike_vendor_buffer_id = 0; static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx, const DetectEngineTransforms *transforms, Flow *f, struct IkeVendorGetDataArgs *cbdata, - int list_id, bool first) + int list_id) { SCEnter(); @@ -64,7 +64,7 @@ static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx, InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id); if (buffer == NULL) return NULL; - if (!first && buffer->inspect != NULL) + if (buffer->initialized) return buffer; const uint8_t *data; @@ -98,8 +98,7 @@ static void PrefilterTxIkeVendor(DetectEngineThreadCtx *det_ctx, const void *pec uint32_t local_id = 0; while (1) { struct IkeVendorGetDataArgs cbdata = { local_id, txv }; - InspectionBuffer *buffer = - IkeVendorGetData(det_ctx, ctx->transforms, f, &cbdata, list_id, true); + InspectionBuffer *buffer = IkeVendorGetData(det_ctx, ctx->transforms, f, &cbdata, list_id); if (buffer == NULL) break; @@ -151,7 +150,7 @@ static uint8_t DetectEngineInspectIkeVendor(DetectEngineCtx *de_ctx, DetectEngin txv, }; InspectionBuffer *buffer = - IkeVendorGetData(det_ctx, transforms, f, &cbdata, engine->sm_list, false); + IkeVendorGetData(det_ctx, transforms, f, &cbdata, engine->sm_list); if (buffer == NULL || buffer->inspect == NULL) break;