pkgsrc/net/net-snmp/patches/patch-el
adam daec5add6c Changes 5.4:
- The default configuration now enables embedded Perl and the Perl
  modules by default when possible unless explicitly disabled. You
  may use the --disable-embedded-perl and --without-perl-modules
  configure options, respectively, to revert to the former default
  configuration.
2007-02-05 12:06:16 +00:00

28 lines
959 B
Text

$NetBSD: patch-el,v 1.2 2007/02/05 12:06:16 adam Exp $
--- perl/OID/OID.xs.orig 2006-10-25 18:16:24.000000000 +0200
+++ perl/OID/OID.xs
@@ -177,16 +177,21 @@ MODULE = NetSNMP::OID PACKAGE = NetSNMP
netsnmp_oid *
nso_newptr(initstring)
char *initstring
+ PREINIT:
+ STRLEN len;
CODE:
if (get_tree_head() == NULL)
netsnmp_init_mib();
RETVAL = SNMP_MALLOC_TYPEDEF(netsnmp_oid);
RETVAL->name = RETVAL->namebuf;
- RETVAL->len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
- if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &RETVAL->len)) {
+ len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
+ if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &len)) {
snmp_log(LOG_ERR, "Can't parse: %s\n", initstring);
RETVAL->len = 0;
RETVAL = NULL;
+ }
+ else {
+ RETVAL->len = len;
}
OUTPUT:
RETVAL