From 14c2c7913c908e4c446cb809e1d7a620cedc16b6 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Fri, 26 Apr 2024 16:07:38 +0200 Subject: [PATCH] libpfctl: fix incorrect pcounters array size The array is 2 x 2 x 2, not 2 x 2 x 3. Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 2 weeks (cherry picked from commit a3f7176523e8611b259cefd7431c01e24f446db7) --- lib/libpfctl/libpfctl.c | 2 +- lib/libpfctl/libpfctl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index f43fb78d9a0..7dc375717ac 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -250,7 +250,7 @@ pfctl_get_status(int dev) _pfctl_get_status_counters(nvlist_get_nvlist(nvl, "scounters"), &status->scounters); - pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 3, + pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 2, (uint64_t *)status->pcounters, NULL); pf_nvuint_64_array(nvl, "bcounters", 2 * 2, (uint64_t *)status->bcounters, NULL); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index edaffdd1211..a2991cc05b0 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -62,7 +62,7 @@ struct pfctl_status { struct pfctl_status_counters lcounters; struct pfctl_status_counters fcounters; struct pfctl_status_counters scounters; - uint64_t pcounters[2][2][3]; + uint64_t pcounters[2][2][2]; uint64_t bcounters[2][2]; };