openbsd-ports/sysutils/snmp_exporter/patches/patch-generator_net_snmp_go
2022-03-07 21:36:41 +00:00

23 lines
757 B
Plaintext

this (which looks like a comment in net_snmp.go as it's wrapped in /* */)
is used to initialise tclist which is a static array normally in
net-snmp's object.
adjust to the size used in net-snmp 5.8; net-snmp zeroes the whole array
during init, walking past the end of snmp_generator's provided array,
and so segfaults. (XXX this code changed again in 5.9 and now does an
initial smaller static alloc, followed by dynamic realloc; it does seem
to still work)
Index: generator/net_snmp.go
--- generator/net_snmp.go.orig
+++ generator/net_snmp.go
@@ -20,7 +20,7 @@ package main
#include <net-snmp/mib_api.h>
#include <unistd.h>
// From parse.c
-#define MAXTC 4096
+#define MAXTC 16384
struct tc {
int type;
int modid;