summaryrefslogtreecommitdiff
path: root/src/cp.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-10-14 09:09:43 +0000
committerJim Meyering <jim@meyering.net>2003-10-14 09:09:43 +0000
commitd7bed21394dc27fa3ff40af2fe5963baf73e1311 (patch)
treee9216bc0104c2f0097889c0233b951ac9b1229eb /src/cp.c
parent49c9c00c8a7dbc571e2ea50ca47f29535699bb8d (diff)
downloadcoreutils-d7bed21394dc27fa3ff40af2fe5963baf73e1311.tar.xz
Fix to avoid a denial-of-service attack if the display width is
enormous. Also, clean up the code a bit by removing duplicate code. (init_column_info): Remove forward decl; no longer needed. (calculate_columns): New function, that contains code that used to be common to print_many_per_line and print_horizontal. (print_many_per_line, print_horizontal): Use it. (decode_switches): Set max_idx here, not in calculate_columns. (print_current_files): Don't call init_column_info; calculate_columns now does that. (init_column_info): Don't allocate a lot more space than is needed to represent the current set of files. Allocate all the new size_t cells in one call to xnmalloc, rather than a row at a time.
Diffstat (limited to 'src/cp.c')
0 files changed, 0 insertions, 0 deletions