diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-03-26 03:58:26 (EDT) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-03-26 03:58:26 (EDT) |
commit | 08e4acd4efc2f67216fb4e1d9be7f597bcf9f371 (patch) | |
tree | b7a54a6cfcbcb35cf3e2d45aa0213da9e86be702 /libbb | |
parent | 3d39889a7b2689be560a92b4d0bf1e086e6605b2 (diff) |
Thanks to Antonio
Propagate gz_open() errors to caller function.
This is not enough, it is still needed to check deb_extract return value
everywhere in libopkg/pkg_extract.c
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
git-svn-id: http://opkg.googlecode.com/svn/trunk@205 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/unarchive.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c index 84a3b6a..38528a3 100644 --- a/libbb/unarchive.c +++ b/libbb/unarchive.c @@ -754,6 +754,10 @@ char *deb_extract(const char *package_filename, FILE *out_stream, if (strcmp(ared_file, ar_header->name) == 0) { /* open a stream of decompressed data */ uncompressed_stream = gz_open(deb_stream, &gunzip_pid); + if (uncompressed_stream == NULL) { + return(NULL); + } + archive_offset = 0; output_buffer = unarchive(uncompressed_stream, out_stream, get_header_tar, free_header_tar, extract_function, prefix, file_list); } @@ -774,6 +778,9 @@ char *deb_extract(const char *package_filename, FILE *out_stream, archive_offset = 0; fseek(deb_stream, 0, SEEK_SET); unzipped_opkg_stream = gz_open(deb_stream, &unzipped_opkg_pid); + if (unzipped_opkg_stream == NULL) { + return(NULL); + } /*fprintf(stderr, __FUNCTION__ ": processing opkg %s -- ared_file=%s\n", package_filename, ared_file);*/ /* walk through outer tar file to find ared_file */ @@ -784,6 +791,9 @@ char *deb_extract(const char *package_filename, FILE *out_stream, if (strcmp(ared_file, tar_header->name+name_offset) == 0) { /* open a stream of decompressed data */ uncompressed_stream = gz_open(unzipped_opkg_stream, &gunzip_pid); + if (uncompressed_stream == NULL) { + return(NULL); + } archive_offset = 0; /*fprintf(stderr, __FUNCTION__ ":%d: here -- found file\n", __LINE__);*/ output_buffer = unarchive(uncompressed_stream, |