freebsd-dev/gnu/usr.bin
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
..
as `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
awk Another round of man page cleanups. 1996-02-12 04:57:03 +00:00
bc Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
binutils/gdb `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
cc Make rules reentrant. 1996-05-28 00:34:38 +00:00
cpio Change "Found end of tape. Load next tape ..." messages to say 1996-04-24 21:20:17 +00:00
cvs Fix a bogon that prevented easy-import from inserting the new module 1996-04-28 12:32:43 +00:00
dc This commit was generated by cvs2svn to compensate for changes in r13122, 1995-12-30 19:02:48 +00:00
dialog recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
diff There's no -p flag to our diff. 1996-05-26 22:27:52 +00:00
diff3 This commit was generated by cvs2svn to compensate for changes in r13122, 1995-12-30 19:02:48 +00:00
gdb Remove this version, it now comes from libc. 1996-05-27 11:02:40 +00:00
grep recursive grep, enabled with -DHAVE_FTS=1 1996-02-02 06:45:26 +00:00
groff remove SHAREDIR?=/usr/share, already defined in bsd.own.mk 1996-05-22 00:26:57 +00:00
gzip faster 1996-05-12 16:20:26 +00:00
ld Aw c'mon. I'm being driven mad by plenty of other things. I don't 1996-06-08 04:52:57 +00:00
man Reviewed by: joerg 1996-06-01 03:19:59 +00:00
mkisofs Moved the include of <sys/types.h> to before the include of <dirent.h> 1996-03-29 14:00:25 +00:00
patch Attempt to break a $Log$ snafu where a *** /--- (minus space) 1996-04-12 11:37:32 +00:00
perl Use setreuid instead of seteuid for permissions management 1996-06-02 19:59:26 +00:00
ptx Removed temporary file. 1996-03-01 15:18:55 +00:00
rcs delete /usr/local/bin from PATH 1996-03-12 23:09:04 +00:00
sdiff Update to GNU diffutils 2.6 1993-11-12 07:05:40 +00:00
send-pr Whoops, do not reference myself. 1996-02-08 21:12:08 +00:00
sort Merged in FreeBSD changes. 1996-02-12 06:45:43 +00:00
tar Spelling fixes. 1996-02-09 21:14:26 +00:00
texinfo remove INFODIR?= /usr/share/info, already defined in bsd.own.mk 1996-05-22 00:29:40 +00:00
Makefile Remove yppush; it's about to be replaced. 1996-01-12 06:43:33 +00:00
Makefile.inc New files for relocated source code. 1994-01-30 00:31:51 +00:00