Re: truncating unsigned value to 32 bits

Wes Hardaker <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Sparta
Message-ID <[email protected]>
>>>>> On Mon, 28 Nov 2005 14:33:27 -0800 (PST), Stuart Kendrick <[email protected]> said:

Stuart> "truncating unsigned value to 32 bits"

Stuart> when i grab this one particular variable, i see the above
Stuart> warning.  

Stuart> what does it mean?

It means someone broke the counter64 parsing code.

Try the following patch to snmplib/asn1.c:

Index: asn1.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/snmplib/asn1.c,v
retrieving revision 5.14
diff -u -p -r5.14 asn1.c
--- asn1.c      12 Oct 2005 10:28:37 -0000      5.14
+++ asn1.c      29 Nov 2005 17:49:10 -0000
@@ -1827,7 +1827,7 @@ asn_parse_unsigned_int64(u_char * data,

     while (asn_length--) {
         high = (high << 8) | ((low & 0xFF000000) >> 24);
-        low = (low << 8) | *bufp++;
+        low = ((low & 0x00FFFFFF) << 8) | *bufp++;
     }

     CHECK_OVERFLOW_U(high,6);


-- 
Wes Hardaker
Sparta, Inc.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.