commit | 8334db13c31f0cc60993739e573034ebbf258f38 | [log] [tgz] |
---|---|---|
author | Denis Vlasenko <vda.linux@googlemail.com> | Fri Aug 15 21:20:23 2008 +0000 |
committer | Denis Vlasenko <vda.linux@googlemail.com> | Fri Aug 15 21:20:23 2008 +0000 |
tree | 0fd6fe1a37450a6343785b098e5fb66a03a8591e | |
parent | 69ed30928eeb1c31196361d70e37ca3010acf8e7 [diff] |
cut: fix buffer overflow (bug 4544).
diff --git a/coreutils/cut.c b/coreutils/cut.c index 0d95ff8..3c9fdbd 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c
@@ -50,7 +50,7 @@ /* set up a list so we can keep track of what's been printed */ int linelen = strlen(line); - char *printed = xzalloc(linelen * sizeof(char)); + char *printed = xzalloc(linelen + 1); char *orig_line = line; unsigned cl_pos = 0; int spos;