File net-snmp-5.4.2_overflow.patch of Package net-snmp

Index: snmplib/mib.c
===================================================================
--- snmplib/mib.c.orig	2008-07-30 09:57:19.000000000 +0200
+++ snmplib/mib.c	2008-10-24 15:30:42.854387100 +0200
@@ -1489,7 +1489,7 @@ sprint_realloc_gauge(u_char ** buf, size
             return 0;
         }
     } else {
-        sprintf(tmp, "%lu", *var->val.integer);
+        sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
         if (!snmp_strcat
             (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
             return 0;
@@ -1553,7 +1553,7 @@ sprint_realloc_counter(u_char ** buf, si
             return 0;
         }
     }
-    sprintf(tmp, "%lu", *var->val.integer);
+    sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
     if (!snmp_strcat
         (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
         return 0;
openSUSE Build Service is sponsored by