$OpenBSD: patch-p0f-query_c,v 1.1 2021/02/10 07:26:38 gnezdo Exp $

-fno-common

Fix memset size mismatch

Index: p0f-query.c
--- p0f-query.c.orig
+++ p0f-query.c
@@ -46,8 +46,8 @@ static _u16 flags;
 static _s16 score = NO_SCORE;
 
 /* Imports for statistics */
-_u32 packet_count, matched_packets, st_time, file_cksum;
-_u8  operating_mode;
+extern _u32 packet_count, matched_packets, st_time, file_cksum;
+extern _u8  operating_mode;
 
 #define SAD_HASH(a)	((((a) << 16) ^ ((a) << 8) ^ (a)))
 
@@ -74,7 +74,7 @@ void p0f_addcache(_u32 saddr,_u32 daddr,_u16 sport,_u1
   cur->dad   = daddr;
   cur->ports = (sport << 16) + dport;
 
-  memset(sc,0,sizeof(sc));
+  memset(sc,0,sizeof(*sc));
   if (genre) {
     strncpy(sc->genre,genre,19);
     strncpy(sc->detail,detail,39);
