aboutsummaryrefslogtreecommitdiff
path: root/src/copyin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/copyin.c')
-rw-r--r--src/copyin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/copyin.c b/src/copyin.c
index c502c7d..042cc41 100644
--- a/src/copyin.c
+++ b/src/copyin.c
@@ -128,17 +128,17 @@ tape_skip_padding (int in_file_des, off_t offset)
static char *
get_link_name (struct cpio_file_stat *file_hdr, int in_file_des)
{
- off_t n = file_hdr->c_filesize + 1;
char *link_name;
- if (n == 0 || n > SIZE_MAX)
+ if (file_hdr->c_filesize < 0 || file_hdr->c_filesize > SIZE_MAX-1)
{
- error (0, 0, _("%s: stored filename length too big"), file_hdr->c_name);
+ error (0, 0, _("%s: stored filename length is out of range"),
+ file_hdr->c_name);
link_name = NULL;
}
else
{
- link_name = xmalloc (n);
+ link_name = xmalloc (file_hdr->c_filesize);
tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
link_name[file_hdr->c_filesize] = '\0';
tape_skip_padding (in_file_des, file_hdr->c_filesize);

Return to:

Send suggestions and report system problems to the System administrator.