summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2004-06-13 13:09:34 +0000
committergrant <grant@pkgsrc.org>2004-06-13 13:09:34 +0000
commit37c6587ce044de5c3aa8c9aa964f8b4e816e00bd (patch)
treefc3249aa7a3bf3986a3276ee62c9f05e7baf884f /textproc
parentf81cc371cfdf06620bc17c8c15d3828d7769946f (diff)
downloadpkgsrc-37c6587ce044de5c3aa8c9aa964f8b4e816e00bd.tar.gz
sync with src:
apply patch in PR to fix argument parsing bug. apply patch in PR to avoid writing to unallocated memory.
Diffstat (limited to 'textproc')
-rw-r--r--textproc/nbsed/files/compile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/textproc/nbsed/files/compile.c b/textproc/nbsed/files/compile.c
index 8cff85c1de1..72cc49913ee 100644
--- a/textproc/nbsed/files/compile.c
+++ b/textproc/nbsed/files/compile.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compile.c,v 1.3 2004/06/13 13:04:02 grant Exp $ */
+/* $NetBSD: compile.c,v 1.4 2004/06/13 13:09:34 grant Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -77,7 +77,7 @@
#if 0
static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: compile.c,v 1.3 2004/06/13 13:04:02 grant Exp $");
+__RCSID("$NetBSD: compile.c,v 1.4 2004/06/13 13:09:34 grant Exp $");
#endif
#endif /* not lint */
@@ -606,6 +606,7 @@ compile_flags(char *p, struct s_subst *s)
gn = 1;
/* XXX Check for overflow */
s->n = (int)strtol(p, &p, 10);
+ p--;
break;
case 'w':
p++;
@@ -670,7 +671,7 @@ compile_tr(char *p, char **transtab)
return (NULL);
}
/* We assume characters are 8 bits */
- lt = xmalloc(UCHAR_MAX);
+ lt = xmalloc(UCHAR_MAX+1);
for (i = 0; i <= UCHAR_MAX; i++)
lt[i] = (char)i;
for (op = old, np = new; *op; op++, np++)