1 --- tar-1.15.1/src/xheader.c.orig 2004-09-06 06:31:14.000000000 -0500
2 +++ tar-1.15.1/src/xheader.c 2006-02-08 16:59:46.000000000 -0500
3 @@ -783,6 +783,32 @@ code_num (uintmax_t value, char const *k
4 xheader_print (xhdr, keyword, sbuf);
8 +decode_num (uintmax_t *num, char const *arg, uintmax_t maxval,
14 + if (! (ISDIGIT (*arg)
15 + && (errno = 0, u = strtoumax (arg, &arg_lim, 10), !*arg_lim)))
17 + ERROR ((0, 0, _("Malformed extended header: invalid %s=%s"),
22 + if (! (u <= maxval && errno != ERANGE))
24 + ERROR ((0, 0, _("Extended header %s=%s is out of range"),
34 dummy_coder (struct tar_stat_info const *st __attribute__ ((unused)),
35 char const *keyword __attribute__ ((unused)),
36 @@ -821,7 +847,7 @@ static void
37 gid_decoder (struct tar_stat_info *st, char const *arg)
40 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
41 + if (decode_num (&u, arg, TYPE_MAXIMUM (gid_t), "gid"))
45 @@ -903,7 +929,7 @@ static void
46 size_decoder (struct tar_stat_info *st, char const *arg)
49 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
50 + if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "size"))
51 st->archive_file_size = st->stat.st_size = u;
54 @@ -918,7 +944,7 @@ static void
55 uid_decoder (struct tar_stat_info *st, char const *arg)
58 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
59 + if (decode_num (&u, arg, TYPE_MAXIMUM (uid_t), "uid"))
63 @@ -946,7 +972,7 @@ static void
64 sparse_size_decoder (struct tar_stat_info *st, char const *arg)
67 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
68 + if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.size"))
72 @@ -962,10 +988,10 @@ static void
73 sparse_numblocks_decoder (struct tar_stat_info *st, char const *arg)
76 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
77 + if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numblocks"))
79 st->sparse_map_size = u;
80 - st->sparse_map = calloc(st->sparse_map_size, sizeof(st->sparse_map[0]));
81 + st->sparse_map = xcalloc (u, sizeof st->sparse_map[0]);
82 st->sparse_map_avail = 0;
85 @@ -982,8 +1008,14 @@ static void
86 sparse_offset_decoder (struct tar_stat_info *st, char const *arg)
89 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
90 + if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.offset"))
92 + if (st->sparse_map_avail < st->sparse_map_size)
93 st->sparse_map[st->sparse_map_avail].offset = u;
95 + ERROR ((0, 0, _("Malformed extended header: excess %s=%s"),
96 + "GNU.sparse.offset", arg));
101 @@ -998,15 +1030,13 @@ static void
102 sparse_numbytes_decoder (struct tar_stat_info *st, char const *arg)
105 - if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
106 + if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numbytes"))
108 if (st->sparse_map_avail == st->sparse_map_size)
110 - st->sparse_map_size *= 2;
111 - st->sparse_map = xrealloc (st->sparse_map,
112 - st->sparse_map_size
113 - * sizeof st->sparse_map[0]);
115 + st->sparse_map = x2nrealloc (st->sparse_map,
116 + &st->sparse_map_size,
117 + sizeof st->sparse_map[0]);
119 st->sparse_map[st->sparse_map_avail++].numbytes = u;
122 --- tar-1.15.1/po/pl.po.orig 2006-03-08 00:05:45.756358000 +0100
123 +++ tar-1.15.1/po/pl.po 2006-03-08 00:10:59.199947750 +0100
124 @@ -1828,3 +1828,18 @@
126 msgid "Malformed extended header: missing equal sign"
127 msgstr "B³êdny nag³ówek rozszerzony: brakuje znaku równo¶ci"
129 +#: src/xheader.c:796
131 +msgid "Malformed extended header: invalid %s=%s"
132 +msgstr "B³êdny nag³ówek rozszerzony: b³êdne %s=%s"
134 +#: src/xheader.c:803
136 +msgid "Extended header %s=%s is out of range"
137 +msgstr "Nag³ówek rozszerzony %s=%s jest spoza zakresu"
139 +#: src/xheader.c:1016
141 +msgid "Malformed extended header: excess %s=%s"
142 +msgstr "B³êdny nag³ówek rozszerzony: nadmiarowe %s=%s"