NET-SNMP 5.5
Compiled for Windows, Visual Studio 2008, .NET Framework 3.5 SP1
When trying to create a new entry in vacmViewTreeFamilyTable, using snmpset utility, setting an Object-Identifier for vacmViewTreeFamilySubtree which contains parts greater than 255 (e.g., .1.3.6.1.4.1.313) will result in "inconsistent name" error being returned from the agent.
This bug was traced to "vacm_vars.c", line number 1554, inside "view_parse_oid" function. Here is the code snippet
1553 for (i = 0; i < subtreeL; i++) {
1554 if (oidIndex[i + viewNameL + 1] > 255) {
1555 free(*viewName);
1556 free(*subtree);
1557 return SNMP_ERR_INCONSISTENTNAME;
1558 }
1559 subtree[0][i] = (oid) oidIndex[i + viewNameL + 1];
1560 }
which unnecessarily checks for the value of each part being confined to 8-bit constraint. This is not needed, since 'subtree' array itself is of type "oid**" which is basically an "unsigned long". This check is only required when we are going to form a "unsigned char" string (as previous parts of the code does). To workaround this, one might just remove the check, since it is of no point here; that is, line number 1554 ~ 1558 must be omitted. I've attached the corrected file.
Corrected file