]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Coverity 1153935: fix confusing sizeof
authorVictor Julien <victor@inliniac.net>
Fri, 17 Jan 2014 10:57:51 +0000 (11:57 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 21 Jan 2014 15:18:17 +0000 (16:18 +0100)
src/app-layer-detect-proto.c

index 45eb466e6a63118acdc71c4266032078e5011be0..353297b26621db485119860b8736ceb9421e7456 100644 (file)
@@ -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;) {