summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaredy <jaredy@openbsd.org>2005-08-18 14:56:25 +0000
committerjaredy <jaredy@openbsd.org>2005-08-18 14:56:25 +0000
commitf8c9eb4dd61d16213d60189057028d9faec25030 (patch)
tree4566babe3bbbf59037909828db2199849aab9870
parentrework the addressing for blinking to make it like the hotspares (diff)
downloadwireguard-openbsd-f8c9eb4dd61d16213d60189057028d9faec25030.tar.xz
wireguard-openbsd-f8c9eb4dd61d16213d60189057028d9faec25030.zip
Properly initialize 'end' in seq(), fixing a crash
on input with long lines when the -n flag is given. ok millert
-rw-r--r--usr.bin/sort/files.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/sort/files.c b/usr.bin/sort/files.c
index d8592a37b10..fb8973518b6 100644
--- a/usr.bin/sort/files.c
+++ b/usr.bin/sort/files.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: files.c,v 1.11 2004/07/20 03:50:27 deraadt Exp $ */
+/* $OpenBSD: files.c,v 1.12 2005/08/18 14:56:25 jaredy Exp $ */
/*-
* Copyright (c) 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)files.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: files.c,v 1.11 2004/07/20 03:50:27 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: files.c,v 1.12 2005/08/18 14:56:25 jaredy Exp $";
#endif
#endif /* not lint */
@@ -267,10 +267,10 @@ seq(FILE *fp, DBT *line, DBT *key)
if (flag) {
flag = 0;
buf = (char *) linebuf;
- end = buf + linebuf_size;
line->data = buf;
}
pos = buf;
+ end = buf + linebuf_size;
while ((c = getc(fp)) != EOF) {
if ((*pos++ = c) == REC_D) {
line->size = pos - buf;