summaryrefslogtreecommitdiff
path: root/textproc/nbsed
diff options
context:
space:
mode:
authorgrant <grant>2004-06-13 13:11:41 +0000
committergrant <grant>2004-06-13 13:11:41 +0000
commit85b4611903a08de4b171d98ebc7c1a709a9c37a9 (patch)
tree977dfb2e507720c91c9bf3d5afd460972bcaeddc /textproc/nbsed
parente411b10a870cc9bccd1e19ddc8b2a3c3663b10b3 (diff)
downloadpkgsrc-85b4611903a08de4b171d98ebc7c1a709a9c37a9.tar.gz
sync with src:
prevent integer underflow. freebsd rev 1.32. via openbsd
Diffstat (limited to 'textproc/nbsed')
-rw-r--r--textproc/nbsed/files/process.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/textproc/nbsed/files/process.c b/textproc/nbsed/files/process.c
index 7242f0d9db4..65b417f4851 100644
--- a/textproc/nbsed/files/process.c
+++ b/textproc/nbsed/files/process.c
@@ -1,4 +1,4 @@
-/* $NetBSD: process.c,v 1.4 2003/10/16 12:04:41 grant Exp $ */
+/* $NetBSD: process.c,v 1.5 2004/06/13 13:11:41 grant Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)process.c 8.6 (Berkeley) 4/20/94";
#else
-__RCSID("$NetBSD: process.c,v 1.4 2003/10/16 12:04:41 grant Exp $");
+__RCSID("$NetBSD: process.c,v 1.5 2004/06/13 13:11:41 grant Exp $");
#endif
#endif /* not lint */
@@ -593,7 +593,7 @@ regsub(SPACE *sp, char *string, char *src)
char c, *dst;
#define NEEDSP(reqlen) \
- if (sp->len >= sp->blen - (reqlen) - 1) { \
+ if (sp->len + (reqlen) + 1 >= sp->blen) { \
sp->blen += (reqlen) + 1024; \
sp->space = sp->back = xrealloc(sp->back, sp->blen); \
dst = sp->space + sp->len; \