Skip to content

Commit

Permalink
tar: fix crash on broken tar file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Welinder committed Dec 3, 2016
1 parent c15c4ec commit 95a8351
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2016-11-30 Morten Welinder <terra@gnome.org>

* gsf/gsf-infile-tar.c (tar_directory_for_file): Handle the case
where what we expected to be a directory is a file. (That implies
a corrupted tar file.) Thanks to Behzad Najjarpour Jabbari,
Secunia Research at Flexera Software for discovering this.

2016-08-20 Morten Welinder <terra@gnome.org>

* configure.ac: Post-release bump.
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
libgsf 1.14.41

Morten:
* Fix corrupted-tar-file crash.

--------------------------------------------------------------------------
libgsf 1.14.40

Expand Down
4 changes: 3 additions & 1 deletion gsf/gsf-infile-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ tar_directory_for_file (GsfInfileTar *dir, const char *name, gboolean last)
gsf_infile_child_by_name (GSF_INFILE (dir),
dirname);
if (subdir) {
dir = GSF_IS_INFILE_TAR (subdir)
? GSF_INFILE_TAR (subdir)
: dir;
/* Undo the ref. */
g_object_unref (subdir);
dir = GSF_INFILE_TAR (subdir);
} else
dir = tar_create_dir (dir, dirname);
}
Expand Down

0 comments on commit 95a8351

Please sign in to comment.