pombreda / libarchive

Automatically exported from code.google.com/p/libarchive
Other
0 stars 0 forks source link

Issue with crashes on archive_write_open_filename_w. #384

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
libarchive 3.1.2, Windows 7+, MSVS2013

1. Call archive_write_open_filename_w with name of file that exists in 
directory  protecting from write operations.
2. Have a nice crash.

Take a look at fix that was provided by our developer:

static int
file_close(struct archive *a, void *client_data)
{
       struct write_file_data     *mine = (struct write_file_data *)client_data;

       (void)a; /* UNUSED */
       if (!(mine->fd < 0)) //! This line have been added.
       {
             close(mine->fd);
       }
       archive_mstring_clean(&mine->filename);
       free(mine);
       return (ARCHIVE_OK);
}

Original issue reported on code.google.com by steel.bo...@gmail.com on 14 Nov 2014 at 12:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I made an incorrect description tho: file 'archive_write_open_filename.c' and 
function 'file_close'

Original comment by steel.bo...@gmail.com on 14 Nov 2014 at 12:57

GoogleCodeExporter commented 9 years ago
I believe this is already fixed in github master.

Could you please try that and let us know?

Original comment by kientzle@gmail.com on 16 Nov 2014 at 1:25