summaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write.c
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2013-03-21 18:59:02 +0000
committermm <mm@FreeBSD.org>2013-03-21 18:59:02 +0000
commit366f42737cba40ceb2e83af8d17c61c0242703c5 (patch)
tree45c2c8840d99cc81725a3970fd3beee587313cf5 /libarchive/archive_write.c
parente7b24010c4d2190a1465594620e629e469c522f8 (diff)
downloadFreeBSD-src-366f42737cba40ceb2e83af8d17c61c0242703c5.zip
FreeBSD-src-366f42737cba40ceb2e83af8d17c61c0242703c5.tar.gz
Update libarchive's vendor dist to version 3.1.2 from release branch.
Git branch: release Git commit: 19f23e191f9d3e1dd2a518735046100419965804 Obtained from: https://github.com/libarchive/libarchive.git
Diffstat (limited to 'libarchive/archive_write.c')
-rw-r--r--libarchive/archive_write.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
index 6fc3907..a3d1a33 100644
--- a/libarchive/archive_write.c
+++ b/libarchive/archive_write.c
@@ -232,6 +232,10 @@ __archive_write_filter(struct archive_write_filter *f,
int r;
if (length == 0)
return(ARCHIVE_OK);
+ if (f->write == NULL)
+ /* If unset, a fatal error has already ocuured, so this filter
+ * didn't open. We cannot write anything. */
+ return(ARCHIVE_FATAL);
r = (f->write)(f, buff, length);
f->bytes_written += length;
return (r);
@@ -437,6 +441,8 @@ archive_write_client_close(struct archive_write_filter *f)
(*a->client_closer)(&a->archive, a->client_data);
free(state->buffer);
free(state);
+ /* Clear the close handler myself not to be called again. */
+ f->close = NULL;
a->client_data = NULL;
return (ret);
}
OpenPOWER on IntegriCloud