From: SourceForge.net <no...@so...> - 2003-02-11 12:57:12
|
Bugs item #671877, was opened at 2003-01-21 16:31 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=671877&group_id=12694 Category: library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Library parses 64 bit unsigned integers incorrectly Initial Comment: Library version: 4.2.1 Testing found that certain values seem to be parsed incorrectly. Code inspection found that 64 bit counters are always parsed as signed integers. The specification defines this value as an unsigned integer. I have attached what should be a fix, based on our testing. Matthias ________________________________________________________________________________________________________ Matthias David Siebler Software Developer Sockeye Networks [mds] diff snmplib/asn1.c 1492a1493,1496 > if (*bufp & 0x80) { > low = ~low; /* integer is negative */ > high = ~high; > } [mds] ---------------------------------------------------------------------- >Comment By: Dave Shield (dts12) Date: 2003-02-11 13:04 Message: Logged In: YES user_id=88893 Hmmm.... I'm not convinced that this patch is correct. Yes - Counters *should* take non-negative values, but they're encoded as BER INTEGERs, which are inherently signed. So if the parsing library receives a negative integer when it's expecting a counter, I don't think that simply ignoring this sign bit is correct. At the very least, we should print some form of debugging statement. And I'm tempted to say that it should perhaps even reject this as a parsing error. (in both asn_parse_unsigned_int and a_p_u_int64) What does anyone else think? [Sent to mailing list as well] ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=671877&group_id=12694 |