From: Tobias Stoeckmann Date: Sat, 6 Jun 2026 09:40:19 +0000 (+0200) Subject: xz: Properly clean up resources on error path X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3de41df401a9710014f4976de6014ec85ffd794b;p=thirdparty%2Flibarchive.git xz: Properly clean up resources on error path If vtable is not set to NULL, close function would be called during shutdown. Since data is already freed and set to NULL, this would lead to a NULL pointer dereference later on. The called library functions should never fail though, so this is a purely defensive measure against future lzma changes. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_read_support_filter_xz.c b/libarchive/archive_read_support_filter_xz.c index 1fff30ab3..501a4772b 100644 --- a/libarchive/archive_read_support_filter_xz.c +++ b/libarchive/archive_read_support_filter_xz.c @@ -524,6 +524,7 @@ xz_lzma_bidder_init(struct archive_read_filter *self) free(state->out_block); free(state); self->data = NULL; + self->vtable = NULL; return (ARCHIVE_FATAL); }