On Tue, Feb 09, 2021 at 11:05:15PM -0800, Greg Steuck wrote:
> I can be talked into removing it as we already have p0f3...

The earlier one is for the format used by pf.os(5) and tcpdump(8)

> 
> OK?

ok jsg@

> 
> From: Greg Steuck <g...@nest.cx>
> Subject: [PATCH] Fix security/p0f -fno-common
> 
> Bonus fix for memset size mismatch noted by clang
> ---
>  security/p0f/Makefile                  |  2 +-
>  security/p0f/patches/patch-p0f-query_c | 29 ++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+), 1 deletion(-)
>  create mode 100644 security/p0f/patches/patch-p0f-query_c
> 
> diff --git security/p0f/Makefile security/p0f/Makefile
> index 36391604eb6..d10523527e4 100644
> --- security/p0f/Makefile
> +++ security/p0f/Makefile
> @@ -3,7 +3,7 @@
>  COMMENT=             passive OS fingerprinting tool
>  
>  DISTNAME=            p0f-2.0.8
> -REVISION =           2
> +REVISION =           3
>  EXTRACT_SUFX=                .tgz
>  CATEGORIES=          security net
>  
> diff --git security/p0f/patches/patch-p0f-query_c 
> security/p0f/patches/patch-p0f-query_c
> new file mode 100644
> index 00000000000..ae6b8afa717
> --- /dev/null
> +++ security/p0f/patches/patch-p0f-query_c
> @@ -0,0 +1,29 @@
> +$OpenBSD$
> +
> +-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);
> -- 
> 2.30.0
> 
> 

Reply via email to