Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Apr 2006 00:50:08 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/usr.bin/systat vmstat.c
Message-ID:  <200604300050.k3U0o8jZ071028@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
bde         2006-04-30 00:50:08 UTC

  FreeBSD src repository

  Modified files:
    usr.bin/systat       vmstat.c 
  Log:
  Backed out rev.1.49 since it had buffer overruns and only worked
  accidentally.
  
  Read buffer overruns:
  The size of the target array (TSOTTA == 10) is a wrong limit to use for
  scanning the source string.
  
  Write buffer overruns:
  TSOTTA is also a wrong limit to use for copying to the target buffer,
  since we want to add a NUL terminator afterwards.  TSOTTA was also 1
  too small for holding both the desired number of visible characters
  and the NUL.
  
  Worked accidentally:
  There is error in the algorithm that tends to result in the space saved
  by stripping "irq" not actually being used, but some cases worked
  accidentally provided "irqN" is near the end of the source string and
  "N" is only 1 digit.
  
  Starting with 5.mumble-CURRENT, "irqN" is at the beginning of the
  string on all (?) arches that have it and the accidents don't happen.
  E.g. on i386's, the keyboard irq is now named
  "irq1: atkbd0<bogus blank padding>" by the kernel, and this name was
  converted to "1: atkb" -- not only the device number but part of the
  device name has been lost --, while before 5.mumble the kernel name
  was "atkbd0 irq1" and systat accidentally preserved the irq number to
  give "atkbd0 1".  The ":" in the string wastes precious space, and
  stripping "irq" results in descriptions starting with numbers which
  makes them look too much like counts.  This commit just fixes the last
  problem.
  
  Revision  Changes    Path
  1.71      +2 -10     src/usr.bin/systat/vmstat.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604300050.k3U0o8jZ071028>