
On Thu, Jul 06, 2006 at 01:24:11PM +0200, Arndt Jonasson wrote:
A second problem I encountered while debugging the above is that this definition:
NiceString ::= TEXTUAL-CONVENTION DISPLAY-HINT "1d1d" STATUS current DESCRIPTION "doc" SYNTAX OCTET STRING (SIZE (2 | 2))
causes smidump to hang. In practice this is not a problem - just fix the SIZE specification in the MIB file.
This is an interesting bug and I am surprised that nobody did run into this before.
The problem seems to be in the implementation of smiGetNextRange() which tries to locate the next range element by comparing that start value of the range. Since both range elements start with the same number, smiGetNextRange() always returns the same element. I did not test it, but the restriction (SIZE (2..3| 2..6)) should exhibit the same behaviour.
Since the bug is in the smiGetNextRange() API function, all smidump backends that look at ranges are affected by the bug and not just the xsd backend.
The obvious fix would be to do a pointer comparison rather than comparing values of the lower bound. Frank, do you recall whether there was a reason not to do a pointer comparison here?
/js