Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-12-16 22:45:01 -0600
committerDan McGee <dan@archlinux.org>2007-12-16 22:45:57 -0600
commitce424a356f73e99fe2247a0d18437399f0e8c5e9 (patch)
tree73e361f68c931230e3aae9fa614dfebe15ab1790 /lib/libalpm
parent20bad3b839ad3d43d477e80d66df8149d2935ab7 (diff)
Check for errors on descfile extraction
If /tmp was full during the early stages of package extraction, we were unable to extract the package description file with the call to archive_read_data_into_fd(archive, fd) becuase we never checked the return code. Add a check to ensure the extraction was successful and print and return an error if it was not instead of falling through to a possibly untrue error message. This should fix FS #8885. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/package.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 88e93de1..f061bf16 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -1032,7 +1032,11 @@ pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full)
/* extract this file into /tmp. it has info for us */
descfile = strdup("/tmp/alpm_XXXXXX");
fd = mkstemp(descfile);
- archive_read_data_into_fd(archive, fd);
+ if(archive_read_data_into_fd(archive, fd) != ARCHIVE_OK) {
+ _alpm_log(PM_LOG_ERROR, _("error extracting package description file to %s\n"),
+ descfile);
+ goto pkg_invalid;
+ }
/* parse the info file */
if(parse_descfile(descfile, info) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s\n"),