Both bugs reported by Kamil Dudka.
* src/create.c (check_exclusion_tags): Do not keep
pointer to a location within tagname: it may change
after xrealloc. Use byte offset instead.
(dump_file0): Close fd before returning without
dumping the directory.
struct exclusion_tag *tag;
size_t dlen = strlen (dirname);
int addslash = !ISSLASH (dirname[dlen-1]);
struct exclusion_tag *tag;
size_t dlen = strlen (dirname);
int addslash = !ISSLASH (dirname[dlen-1]);
for (tag = exclusion_tags; tag; tag = tag->next)
{
for (tag = exclusion_tags; tag; tag = tag->next)
{
tagname = xrealloc (tagname, tagsize);
}
tagname = xrealloc (tagname, tagsize);
}
{
strcpy (tagname, dirname);
{
strcpy (tagname, dirname);
- strcpy (nptr, tag->name);
+ strcpy (tagname + noff, tag->name);
if (access (tagname, F_OK) == 0
&& (!tag->predicate || tag->predicate (tagname)))
{
if (access (tagname, F_OK) == 0
&& (!tag->predicate || tag->predicate (tagname)))
{
{
exclusion_tag_warning (st->orig_file_name, tag_file_name,
_("directory not dumped"));
{
exclusion_tag_warning (st->orig_file_name, tag_file_name,
_("directory not dumped"));
+ if (fd >= 0)
+ close (fd);