Skip to content

Commit

Permalink
libarchive: set some pointers to NULL
Browse files Browse the repository at this point in the history
Reported by:	Ted Unangst
Bug bounty:	$2
  • Loading branch information
gperciva committed Feb 19, 2025
1 parent 1886226 commit 7b16d03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions libarchive/archive_entry_link_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ archive_entry_linkresolver_new(void)
if (res == NULL)
return (NULL);
memset(res, 0, sizeof(struct archive_entry_linkresolver));
res->spare = NULL;
res->number_buckets = links_cache_initial_size;
res->buckets = malloc(res->number_buckets *
sizeof(res->buckets[0]));
Expand Down
1 change: 1 addition & 0 deletions tar/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ tree_open(const char *path)
if (t == NULL)
abort();
memset(t, 0, sizeof(*t));
t->buff = NULL;
tree_append(t, path, strlen(path));
#ifdef HAVE_FCHDIR
t->initialDirFd = open(".", O_RDONLY);
Expand Down

0 comments on commit 7b16d03

Please sign in to comment.