Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2017 19:08:46 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 219689] [PATCH] systat segfault when invoked with some invalid arguments
Message-ID:  <bug-219689-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219689

            Bug ID: 219689
           Summary: [PATCH] systat segfault when invoked with some invalid
                    arguments
           Product: Base System
           Version: 11.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: mt@markoturk.info
          Keywords: patch

Created attachment 183110
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D183110&action=
=3Dedit
patch

Hi,

some combinations of invalid arguments can crash systat.

For example:
systat -vmstat -d
Segmentation fault (core dumped)

I've attached a patch that fixes this.

(gdb) bt
#0  strlen (str=3D0x0) at /usr/src/lib/libc/string/strlen.c:100
#1  0x0000000801170092 in strdup (str=3D0x0) at
/usr/src/lib/libc/string/strdup.c:46
#2  0x0000000000403c12 in dsselect (args=3D0x0, select_mode=3DDS_SELECT_ADD=
ONLY,
maxshowdevs=3D7, s1=3D0x621e00) at /usr/src/usr.bin/systat/devs.c:267
#3  0x000000000040ff4e in cmdkre (cmd=3D<value optimized out>, args=3D0x0) =
at
_ctype.h:107
#4  0x0000000000405955 in main (argc=3D<value optimized out>, argv=3D<value
optimized out>) at /usr/src/usr.bin/systat/main.c:225
#5  0x0000000000402f1f in _start ()
#6  0x000000080063a000 in ?? ()
#7  0x0000000000000000 in ?? ()

/Marko

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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