Commit Graph

19 Commits

Author SHA1 Message Date
jmallett
0871762074 Check for possible overflow from sysconf _SC_ARG_MAX and error out in a
correct manner.  Revert my incorrect change to use err(3) for malloc(3)
failing.  Use a size_t variable to store the size of the argument buffer
we allocate, and remove silly casts as the result of having this around.
Modify the math in some of the paranoid checks for buffer overflow to
account for the fact we now are dealing with the actual size of the
buffer.  Remove the static qualifier for arg_max, and the bogus setting
of it to -1.

Include <limits.h> for the definitions we use to check for possible
overflows.

Submitted by:	bde
2002-05-05 04:42:50 +00:00
jmallett
896541a042 Don't cast incorrectly to malloc(3), and don't use errx(3) if malloc(3)
returns NULL, as malloc(3) sets errno.  Use err(3).
2002-05-02 05:46:37 +00:00
markm
aa05461c14 WARNS=4 fixes (incomplete, so set NO_WERROR), and lots of extra
cleanup courtesy of automatic checking (lint).
2002-02-03 14:43:04 +00:00
imp
50014e3541 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
mikeh
b216600a84 Prevent overflowing the buffer that stores the command arguments.
PR:		bin/19422
Not objected to by: -audit
MFC after:	3 weeks
2002-01-20 01:30:40 +00:00
peter
66312e4a8d $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
bde
5462b94b62 Fixed -Wall regression (broken in rev.1.12). Removed unused includes. 1998-12-07 10:25:48 +00:00
jkoshy
e27dc1bad8 Remove compile time dependency on ARG_MAX.
PR: 1791 (partial)
Reviewed by: Bruce Evans <bde@freebsd.org>, Tor Egge <tegge@freebsd.org>
1998-06-17 11:33:10 +00:00
charnier
cf1a881890 Correct use of .Nm. Add rcsid. 1998-05-15 06:30:58 +00:00
guido
b27e3f2aef Fix buffer overflow (probably unexploitable). 1997-03-10 19:10:08 +00:00
peter
83b3c2c161 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
steve
c5d0f9cb39 -Wall cleaning. 1996-12-14 06:08:03 +00:00
ache
ac2673a0e9 Remove unneded ctype.h 1995-10-23 21:03:40 +00:00
dg
612646eb4c Fix previous fix that removes an unnecessary space; the output is now
just like it was in 1.1.5.
1995-03-09 20:40:17 +00:00
ats
61a9f7372b Fix an error to prevent some core dumps from ps.
You can get ps easily to core dump, if you are running a "make depend"
on a kernel in one window and a "ps -auxww" in another. The ww will
try to give you the full argument list of the command that can
now be 64Kb large, but ps expected only 4Kb large arg arrays and
doesn't check for overflows.
1994-11-10 23:25:12 +00:00
dg
8722740e7f Added $Id$ 1994-09-24 02:59:15 +00:00
dg
579d5f0530 Got rid of extra space between args and (command). 1994-08-18 14:30:53 +00:00
rgrimes
e3cfc8ce61 BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00