From: Victor Julien Date: Fri, 17 Jan 2014 10:57:51 +0000 (+0100) Subject: Coverity 1153935: fix confusing sizeof X-Git-Tag: suricata-2.0rc1~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f1f395bb52a4c3ffd6a491a4cc3c9dd57a2bdc8;p=thirdparty%2Fsuricata.git Coverity 1153935: fix confusing sizeof --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 45eb466e6a..353297b266 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -1057,10 +1057,10 @@ static int AppLayerProtoDetectPMMapSignatures(AppLayerProtoDetectPMCtx *ctx) max_pat_id = ctx->max_pat_id; - ctx->map = SCMalloc((max_pat_id) * sizeof(ctx->map)); + ctx->map = SCMalloc((max_pat_id) * sizeof(AppLayerProtoDetectPMSignature *)); if (ctx->map == NULL) goto error; - memset(ctx->map, 0, (max_pat_id) * sizeof(ctx->map)); + memset(ctx->map, 0, (max_pat_id) * sizeof(AppLayerProtoDetectPMSignature *)); /* add an array indexed by pattern id to look up the sig */ for (s = ctx->head; s != NULL;) {