Page 1 of 1

Reading SNMP Community Strings

Posted: Fri Apr 01, 2016 2:39 pm
by SeeCwriter
I'm trying to read SNMP community strings. But the function I wrote crashes.(MOD5441X)

Code: Select all

char *GetReadOnlyCommunityString( char *p )
{
	const SysInfo *pInfo = GetSysInfo();
	strncpy( p, (char *)pInfo->ReadCommunity, 40 );
	*(p+40) = NUL;
	return p;
}
What am I doing wrong?

v2.7.5 NNDK.

Re: Reading SNMP Community Strings

Posted: Fri Apr 01, 2016 2:50 pm
by SeeCwriter
Never mind. Buffer overflow. Doomkoff!

Re: Reading SNMP Community Strings

Posted: Fri Apr 01, 2016 3:20 pm
by dciliske
That was the question I thought to ask, but was like "Nah... Surely he checked that, must be some weird esoteric SNMP thing". XD

I tend to stay away from SNMP lest the abyss start staring back. Lord knows I get that enough with TLS.