From: Victor Julien Date: Mon, 20 Mar 2023 09:47:47 +0000 (+0100) Subject: detect/pcre: use util funcs for buffer test X-Git-Tag: suricata-7.0.0-rc2~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=501388c91250ea80bb78081b0c343da8ffc22689;p=thirdparty%2Fsuricata.git detect/pcre: use util funcs for buffer test --- diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 1cf85e5e94..cce9729fb1 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -1170,7 +1170,8 @@ static int DetectPcreParseTest10(void) FAIL_IF(DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0); FAIL_IF_NOT(DetectPcreSetup(de_ctx, s, "/bamboo/") == 0); - FAIL_IF_NOT(s->sm_lists[g_dce_stub_data_buffer_id] == NULL && s->sm_lists[DETECT_SM_LIST_PMATCH] != NULL); + FAIL_IF_NOT(DetectBufferGetFirstSigMatch(s, g_dce_stub_data_buffer_id) == NULL); + FAIL_IF_NOT(s->init_data->smlists[DETECT_SM_LIST_PMATCH] != NULL); SigFree(de_ctx, s); @@ -1179,7 +1180,8 @@ static int DetectPcreParseTest10(void) /* failure since we have no preceding content/pcre/bytejump */ FAIL_IF_NOT(DetectPcreSetup(de_ctx, s, "/bamboo/") == 0); - FAIL_IF_NOT(s->sm_lists[g_dce_stub_data_buffer_id] == NULL && s->sm_lists[DETECT_SM_LIST_PMATCH] != NULL); + FAIL_IF_NOT(DetectBufferGetFirstSigMatch(s, g_dce_stub_data_buffer_id) == NULL); + FAIL_IF_NOT(s->init_data->smlists[DETECT_SM_LIST_PMATCH] != NULL); SigFree(de_ctx, s); DetectEngineCtxFree(de_ctx);