mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
cut: fix buffer overflow (bug 4544).
This commit is contained in:
parent
69ed30928e
commit
8334db13c3
@ -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 */
|
/* set up a list so we can keep track of what's been printed */
|
||||||
int linelen = strlen(line);
|
int linelen = strlen(line);
|
||||||
char *printed = xzalloc(linelen * sizeof(char));
|
char *printed = xzalloc(linelen + 1);
|
||||||
char *orig_line = line;
|
char *orig_line = line;
|
||||||
unsigned cl_pos = 0;
|
unsigned cl_pos = 0;
|
||||||
int spos;
|
int spos;
|
||||||
|
Loading…
Reference in New Issue
Block a user