uninitialised variable: NotificationOriginator::mib

In the latest Agent++, variable NotificationOriginator::mib is not initialised in the default ctor.

*** notification_originator.cpp 2020-06-04 09:41:46.000000000 +1000
— prev/notification_originator.cpp 2020-06-04 09:41:46.000000000 +1000


*** 56,68 ****
notifyEntry = 0;
notifyFilterEntry = 0;
#ifdef _SNMPv3
_nlmLogEntry = 0;
#endif
v3mp = 0;
!
}

NotificationOriginator::~NotificationOriginator()
{
#ifdef _SNMPv3
if (localEngineID)
— 56,68 ----
notifyEntry = 0;
notifyFilterEntry = 0;
#ifdef _SNMPv3
_nlmLogEntry = 0;
#endif
v3mp = 0;
! mib = 0;
}

NotificationOriginator::~NotificationOriginator()
{
#ifdef _SNMPv3
if (localEngineID)

Yes, that is a bug, because according the constructor documentation it should be initialised with Mib::instance. The folllowing code fixes that. Nevertheless, the default constructor is deprecated and should no longer be used anyway. Please use NotificationOriginator(Mib*) instead.

NotificationOriginator::NotificationOriginator()
{
#ifdef _SNMPv3
	localEngineID = 0;
#endif
        targetAddrEntry = 0;
        targetParamsEntry = 0;
        communityEntry = 0;
        notifyEntry = 0;
        notifyFilterEntry = 0;
        _nlmLogEntry = 0;
        v3mp = 0;
        mib = Mib::instance;        
}

This will be fixed in the next release.