On Tue, Mar 05, 2002 at 02:34:18AM -0800, Guy Harris wrote:
> The bad news is that the other captures appear to be overflowing a
> fixed-size buffer internal to the UCD SNMP library.
>
> The good news is that UCD SNMP 4.2.2 introduced (but didn't document in
> the man pages) APIs that looks as if they support formatting object IDs
> and variables into a dynamically-growing buffer, rather than into a
> fixed buffer, so that if we require UCD SNMP 4.2.2 or later, we can
> probably fix that particular problem.
...and the bad news is that they *STILL*, even in the 5.0-pre1 release
of NET-SNMP, have on-the-stack buffers into which they format OIDs -
"sprint_realloc_value()", although the buffer into which it formats the
variable binding value is dynamically grown, formats the OID into a
fixed-length on-the-stack buffer. If it doesn't fit, you lose - badly.
Fortunately, it looks as if "sprint_realloc_value()" doesn't actually
*use* the resulting buffer, so perhaps if "get_symbol()" were modified
to allow a null pointer as the last argument, meaning "don't bother
formatting the OID for this object, please", it might work better. I'll
look at tweaking the SNMP library to do that, and, if it works, I'll
send patches off to the NET-SNMP maintainers (for both 4.2[.x] and 5.0).