From 07605051f5886ffd05f65cfbc1804c316ed904ba Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 25 Feb 2016 20:02:19 +0000 Subject: [PATCH] Avoid deep recusion when AUTOLOAD and carp collide --- ChangeLog | 5 +++-- Info.pm | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d207f36..3ce0a6e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,8 +4,9 @@ version 3.32 () [BUG FIXES] - * Support undefined (noSuchIntance) values in Offline mode - * Do not init table cache if Cache provided by user + * Support undefined (noSuchInstance) values in Offline mode + * Do not init table cache if Cache provided by usera + * Avoid deep recusion when AUTOLOAD and carp collide version 3.31 (2016-01-22) diff --git a/Info.pm b/Info.pm index 1a087f49..b72f6581 100644 --- a/Info.pm +++ b/Info.pm @@ -3794,6 +3794,7 @@ These methods return data as a scalar. sub _global { my $method = shift; my $oid = shift; + return sub {} if $method eq 'CARP_TRACE'; return sub { my $self = shift; @@ -4521,6 +4522,11 @@ sub _validate_autoload_method { $leaf_name =~ s/_/-/g; } + # skip if offline + if ( $self->{Offline} ) { + return [1,(exists $self->{store}->{$method} ? 1: 0)]; + } + # Translate MIB leaf node name to OID my $oid = SNMP::translateObj($leaf_name);