|
|
|
|
@ -420,7 +420,7 @@ static inline void SCACBSCreateFailureTable(MpmCtx *mpm_ctx)
|
|
|
|
|
|
|
|
|
|
/* allot space for the failure table. A failure entry in the table for
|
|
|
|
|
* every state(SCACBSCtx->state_count) */
|
|
|
|
|
ctx->failure_table = SCCalloc(1, ctx->state_count * sizeof(int32_t));
|
|
|
|
|
ctx->failure_table = SCCalloc(ctx->state_count, sizeof(int32_t));
|
|
|
|
|
if (ctx->failure_table == NULL) {
|
|
|
|
|
FatalError("Error allocating memory");
|
|
|
|
|
}
|
|
|
|
|
@ -681,7 +681,7 @@ static inline void SCACBSCreateModDeltaTable(MpmCtx *mpm_ctx)
|
|
|
|
|
|
|
|
|
|
/* buffer to hold pointers in the buffer, so that a state can use it
|
|
|
|
|
* directly to access its state data */
|
|
|
|
|
ctx->state_table_mod_pointers = SCCalloc(1, ctx->state_count * sizeof(uint8_t *));
|
|
|
|
|
ctx->state_table_mod_pointers = SCCalloc(ctx->state_count, sizeof(uint8_t *));
|
|
|
|
|
if (ctx->state_table_mod_pointers == NULL) {
|
|
|
|
|
FatalError("Error allocating memory");
|
|
|
|
|
}
|
|
|
|
|
@ -750,7 +750,7 @@ static inline void SCACBSCreateModDeltaTable(MpmCtx *mpm_ctx)
|
|
|
|
|
|
|
|
|
|
/* buffer to hold pointers in the buffer, so that a state can use it
|
|
|
|
|
* directly to access its state data */
|
|
|
|
|
ctx->state_table_mod_pointers = SCCalloc(1, ctx->state_count * sizeof(uint8_t *));
|
|
|
|
|
ctx->state_table_mod_pointers = SCCalloc(ctx->state_count, sizeof(uint8_t *));
|
|
|
|
|
if (ctx->state_table_mod_pointers == NULL) {
|
|
|
|
|
FatalError("Error allocating memory");
|
|
|
|
|
}
|
|
|
|
|
@ -861,7 +861,7 @@ int SCACBSPreparePatterns(MpmCtx *mpm_ctx)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* alloc the pattern array */
|
|
|
|
|
ctx->parray = (MpmPattern **)SCCalloc(1, mpm_ctx->pattern_cnt * sizeof(MpmPattern *));
|
|
|
|
|
ctx->parray = (MpmPattern **)SCCalloc(mpm_ctx->pattern_cnt, sizeof(MpmPattern *));
|
|
|
|
|
if (ctx->parray == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
mpm_ctx->memory_cnt++;
|
|
|
|
|
@ -887,7 +887,7 @@ int SCACBSPreparePatterns(MpmCtx *mpm_ctx)
|
|
|
|
|
ctx->single_state_size = sizeof(int32_t) * 256;
|
|
|
|
|
|
|
|
|
|
/* handle no case patterns */
|
|
|
|
|
ctx->pid_pat_list = SCCalloc(1, (mpm_ctx->max_pat_id + 1) * sizeof(SCACBSPatternList));
|
|
|
|
|
ctx->pid_pat_list = SCCalloc((mpm_ctx->max_pat_id + 1), sizeof(SCACBSPatternList));
|
|
|
|
|
if (ctx->pid_pat_list == NULL) {
|
|
|
|
|
FatalError("Error allocating memory");
|
|
|
|
|
}
|
|
|
|
|
@ -949,7 +949,7 @@ void SCACBSInitCtx(MpmCtx *mpm_ctx)
|
|
|
|
|
mpm_ctx->memory_size += sizeof(SCACBSCtx);
|
|
|
|
|
|
|
|
|
|
/* initialize the hash we use to speed up pattern insertions */
|
|
|
|
|
mpm_ctx->init_hash = SCCalloc(1, sizeof(MpmPattern *) * MPM_INIT_HASH_SIZE);
|
|
|
|
|
mpm_ctx->init_hash = SCCalloc(MPM_INIT_HASH_SIZE, sizeof(MpmPattern *));
|
|
|
|
|
if (mpm_ctx->init_hash == NULL) {
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|