← Commit list

8334db13c

Denis Vlasenko
Denis Vlasenko
2008-08-15
FAILED Duration: 20s

Subject

cut: fix buffer overflow (bug 4544).

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/cut.c+1 -1
@@ -50,7 +50,7 @@ static void cut_file(FILE *file, char delim, const struct cut_list *cut_lists, u
/* 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;