detect/content: use const pointer where possible

pull/9939/head
Victor Julien 1 year ago committed by Victor Julien
parent 643f25280b
commit 8ba7f23c9b

@ -126,8 +126,7 @@ int DetectEngineContentInspectionInternal(DetectEngineCtx *de_ctx, DetectEngineT
/* \todo unify this which is phase 2 of payload inspection unification */
if (smd->type == DETECT_CONTENT) {
DetectContentData *cd = (DetectContentData *)smd->ctx;
const DetectContentData *cd = (const DetectContentData *)smd->ctx;
SCLogDebug("inspecting content %"PRIu32" buffer_len %"PRIu32, cd->id, buffer_len);
/* we might have already have this content matched by the mpm.

@ -176,9 +176,8 @@ error:
* earlier changes. Thus the highest priority modifications should be
* applied last.
*/
DetectReplaceList *DetectReplaceAddToList(DetectReplaceList *replist,
uint8_t *found,
DetectContentData *cd)
DetectReplaceList *DetectReplaceAddToList(
DetectReplaceList *replist, uint8_t *found, const DetectContentData *cd)
{
DetectReplaceList *newlist;

@ -26,7 +26,8 @@
#include "detect-content.h"
DetectReplaceList * DetectReplaceAddToList(DetectReplaceList *replist, uint8_t *found, DetectContentData *cd);
DetectReplaceList *DetectReplaceAddToList(
DetectReplaceList *replist, uint8_t *found, const DetectContentData *cd);
/* Internal functions are only called via the inline functions below. */
void DetectReplaceExecuteInternal(Packet *p, DetectReplaceList *replist);

@ -721,7 +721,7 @@ typedef struct DetectPatternTracker {
} DetectPatternTracker;
typedef struct DetectReplaceList_ {
struct DetectContentData_ *cd;
const struct DetectContentData_ *cd;
uint8_t *found;
struct DetectReplaceList_ *next;
} DetectReplaceList;

Loading…
Cancel
Save