From: Sergey Poznyakoff Date: Fri, 26 Mar 2004 19:39:40 +0000 (+0000) Subject: (write_long_name): Do not allow more than X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=d8981440bb23af48a6c72379095aa38fe88ce3fb;hp=7f2e3cf63a21c7462af798e927a6ec472a3a6677;p=chaz%2Ftar (write_long_name): Do not allow more than NAME_FIELD_SIZE-1 characters in a file name for V7 format archives. --- diff --git a/src/create.c b/src/create.c index 4c954c4..a46b116 100644 --- a/src/create.c +++ b/src/create.c @@ -519,7 +519,16 @@ write_long_name (struct tar_stat_info *st) xheader_store ("path", st, NULL); break; - case V7_FORMAT: + case V7_FORMAT: + if (strlen (st->file_name) > NAME_FIELD_SIZE-1) + { + WARN ((0, 0, _("%s: file name is too long (max %d); not dumped"), + quotearg_colon (st->file_name), + NAME_FIELD_SIZE - 1)); + return NULL; + } + break; + case USTAR_FORMAT: case STAR_FORMAT: return write_ustar_long_name (st->file_name);