summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/compile.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2004-07-10 11:41:26 +0000
committerotto <otto@openbsd.org>2004-07-10 11:41:26 +0000
commit9318432458bb41e76ca23b39464d96adb0cfaa1e (patch)
tree5430d42ccfe1529bd5430ad897f63cfa6f9db267 /usr.bin/sed/compile.c
parentFix reverse logic bug in the prefix filter. (diff)
downloadwireguard-openbsd-9318432458bb41e76ca23b39464d96adb0cfaa1e.tar.xz
wireguard-openbsd-9318432458bb41e76ca23b39464d96adb0cfaa1e.zip
xmalloc()->xrealloc() so that patterns larger than _POSIX2_LINE_MAX*2-1
work. From mycroft@netbsd. ok millert@
Diffstat (limited to 'usr.bin/sed/compile.c')
-rw-r--r--usr.bin/sed/compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index f32c6daddb9..7bca0152f39 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compile.c,v 1.19 2004/07/09 19:39:40 otto Exp $ */
+/* $OpenBSD: compile.c,v 1.20 2004/07/10 11:41:26 otto Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */
-static char *rcsid = "$OpenBSD: compile.c,v 1.19 2004/07/09 19:39:40 otto Exp $";
+static char *rcsid = "$OpenBSD: compile.c,v 1.20 2004/07/10 11:41:26 otto Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -503,7 +503,7 @@ compile_subst(char *p, struct s_subst *s)
size += sp - op;
if (asize - size < _POSIX2_LINE_MAX + 1) {
asize *= 2;
- text = xmalloc(asize);
+ text = xrealloc(text, asize);
}
} while (cu_fgets(p = lbuf, sizeof(lbuf)));
err(COMPILE, "unterminated substitute in regular expression");