[tkined] Tnm 2.1.10 incorrectly encode value 0 for COUNTER64

Simon Chow (skchow@cisco.com)
Mon, 21 Dec 1998 13:02:13 -0800

Juergen,

While using Scotty for testing recently, I discovered a problem on Scotty
while encoding the value 0 in BER using type COUNTER64, I make the
following modification in "tnmAsn1.c" to correct the problem. I also
check the 3.0.0 snapshot code, same problem exist.

I guess it is unusual to issue a SET pdu on a COUNTER64 object, but I was
just testing the agent to make sure it behave properly. I suppose this
problem will show up if one implements COUNTER64 in a Scotty agent.

/Simon

$ diff tnmAsn1.c.org tnmAsn1.c
639,640c639,648
< for (d = value; d >= 1; asnlen++) {
< d /= 256.0;

---
>    /*
>     * Simon Chow: C64 length field not encoded properly when value=0
>     * Simon Chow: added check for value=0 condition
>     */
>     if (value==0.0) {
>         asnlen = 1;
>     } else {
>         for (d = value; d >= 1; asnlen++) {
>             d /= 256.0;
>     }

Simon Chow _____________________________________________________________________________ MS: SJ-G1 email: skchow@cisco.com Cisco Systems, Inc. | | WWW: www.employees.org/~simon 170 West Tasman Drive .:|||:..:|||:. Voice: +1 (408) 527-1890 San Jose, CA 95134 Cisco Systems Fax: +1 (408) 526-6899 _____________________________________________________________________________ #include <std/disclaimer.h>

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.