https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267684
Bug ID: 267684
Summary: ministat segmentation fault
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
[Noticed in the OpenBSD port.]
$ printf "0\n0\n0\n" | ministat - -
Segmentation fault (core dumped)
The problem is [in ministat.c] at line 646:
nds = argc;
for (i = 0; i < nds; i++) {
setfilenames[i] = argv[i];
if (!strcmp(argv[i], "-"))
----> setfiles[0] = stdin;
else
setfiles[i] = fopen(argv[i], "r");
if (setfiles[i] == NULL)
err(2, "Cannot open %s", argv[i]);
}
The simplest fix is just to change that to:
setfiles[i] = stdin;
With that in place, ministat will error out reporting that
(on second reading) the input has fewer than 3 data points.
--
You are receiving this mail because:
You are the assignee for the bug.