Hello.

In if-mib/data_access/interface_linux.c there are some horrible sscanf
patterns that try to read out 10 values from a line. The problem is that
there are only 9 format specifiers without stars in the format.

Given the names of the variables i think i have removed the right * in the
attached patch.

/MF
Index: agent/mibgroup/if-mib/data_access/interface_linux.c
===================================================================
RCS file: 
/cvsroot/net-snmp/net-snmp/agent/mibgroup/if-mib/data_access/interface_linux.c,v
retrieving revision 1.11
diff -c -r1.11 interface_linux.c
*** agent/mibgroup/if-mib/data_access/interface_linux.c 26 Aug 2004 14:31:52 -0000     
 1.11
--- agent/mibgroup/if-mib/data_access/interface_linux.c 26 Aug 2004 21:36:46 -0000
***************
*** 53,59 ****
      uintmax_t       snd_pkt, snd_oct, snd_err, snd_drop, coll;
      const char     *scan_line_2_2 =
          "%"   SCNuMAX " %"  SCNuMAX " %"  SCNuMAX " %"  SCNuMAX
!         " %*" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX
          " %"  SCNuMAX " %"  SCNuMAX " %"  SCNuMAX " %"  SCNuMAX
          " %*" SCNuMAX " %"  SCNuMAX;
      const char     *scan_line_2_0 =
--- 53,59 ----
      uintmax_t       snd_pkt, snd_oct, snd_err, snd_drop, coll;
      const char     *scan_line_2_2 =
          "%"   SCNuMAX " %"  SCNuMAX " %"  SCNuMAX " %"  SCNuMAX
!         " %*" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX " %"  SCNuMAX
          " %"  SCNuMAX " %"  SCNuMAX " %"  SCNuMAX " %"  SCNuMAX
          " %*" SCNuMAX " %"  SCNuMAX;
      const char     *scan_line_2_0 =
***************
*** 64,70 ****
      unsigned long   rec_pkt, rec_oct, rec_err, rec_drop, rec_mcast;
      unsigned long   snd_pkt, snd_oct, snd_err, snd_drop, coll;
      const char     *scan_line_2_2 =
!         "%lu %lu %lu %lu %*lu %*lu %*lu %*lu %lu %lu %lu %lu %*lu %lu";
      const char     *scan_line_2_0 =
          "%lu %lu %*lu %*lu %*lu %lu %lu %*lu %*lu %lu";
  #endif
--- 64,70 ----
      unsigned long   rec_pkt, rec_oct, rec_err, rec_drop, rec_mcast;
      unsigned long   snd_pkt, snd_oct, snd_err, snd_drop, coll;
      const char     *scan_line_2_2 =
!         "%lu %lu %lu %lu %*lu %*lu %*lu %lu %lu %lu %lu %lu %*lu %lu";
      const char     *scan_line_2_0 =
          "%lu %lu %*lu %*lu %*lu %lu %lu %*lu %*lu %lu";
  #endif

Reply via email to