freebsd kernel with SKQ
Go to file
Bill Paul a13bb127d2 Aw c'mon. I'm being driven mad by plenty of other things. I don't
need this.

Consider the following code:

	case 'O':
		output_filename = malloc(strlen(arg)+4);
		strcpy(output_filename, arg);
		strcat(output_filename, ".tmp");
		real_output_filename = arg;
		return;

The idea here is to malloc() a buffer big enough to hold the name of
a supplied file name, plus ".tmp". So we malloc() 'size of filename'
bytes plus 4, right? Wrong! ".tmp" is _FIVE_ bytes long! There's a
traling '\0' which strcat() gleefully tacks on _outside_ the bounds
of the buffer. Result: program corrupts own memory. Program SEGVs at
seemingly random times. Bill not like random SEGVs. Bill smash.

Know how I found this? I've been trying to bootstrap -current on my
2.1.0-RELEASE machine at work and I couldn't seem to get libc.a built
because the linker would intermittently blow chunks while executing
things like 'ld -O foo.o -X -r foo.o'. Since this is an initial
bootstrap version of ld, it was linked against the 2.1.0 libc, who's
malloc() behaves differently than that in -current.

Presumeably ld -O doesn't blow up in -current, otherwise someone would
have spotted this already. I don't know if this is a bug or a feature.

Anyway. I'm changing the strlen(arg)+4 to strlen(arg)+5. Bah.
1996-06-08 04:52:57 +00:00
bin Backup yacc changes. 1996-06-02 17:06:40 +00:00
eBones Bring in a change that got lost when we spammed over the CVS repository 1996-06-05 22:48:04 +00:00
etc IDE cd fixes: 1996-06-07 15:47:15 +00:00
games Activate collate 1996-06-05 16:41:10 +00:00
gnu Aw c'mon. I'm being driven mad by plenty of other things. I don't 1996-06-08 04:52:57 +00:00
include Now that Peter has been nice enough to bail me out of my last little 1996-06-05 03:47:18 +00:00
lib Document that truncate can also be used to extend the size of a file, 1996-06-07 01:34:47 +00:00
libexec Take ypxfrd_xdr.c out of SRCS line. It should be included in librpcsvc, 1996-06-06 03:58:06 +00:00
lkm `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
release Various fixes, take power.uu out as it was causing overflows. We'll 1996-06-07 11:46:19 +00:00
sbin Return make_union, s-bit removed 1996-05-19 17:24:10 +00:00
secure Bring in a change that got lost when we spammed over the CVS repository 1996-06-05 22:48:04 +00:00
share Update contact information and add latest donor to gallery. 1996-06-08 03:10:11 +00:00
sys A trailing patch Jim left out of the last commit. 1996-06-07 22:55:14 +00:00
tools Don't look in libkern, it went away. 1995-12-29 01:51:23 +00:00
usr.bin Fix exit code when used in non-interactive mode. 1996-06-08 04:30:06 +00:00
usr.sbin Change min_free to return free space as an off_t instead of a size_t. 1996-06-08 00:46:33 +00:00
COPYRIGHT This is the official 4.4 Lite copyright. 1994-09-11 07:53:28 +00:00
Makefile 1) make -DCLOBBER not remove most of /usr/lib 1996-05-04 07:12:07 +00:00