From 105b46dcfa04b92674bf0c18f93f9438d8d9ef9a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 4 Aug 2014 20:46:24 -0500 Subject: [PATCH] write.c: Fix handling of NULL context in stream_filtered() A NULL filter_context is supposed to be valid and interpreted as "don't filter anything". This case can't be triggered by wimlib-imagex, but it might be possible via custom library calls. --- src/write.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/write.c b/src/write.c index 91954f9f..39e8bd0a 100644 --- a/src/write.c +++ b/src/write.c @@ -102,12 +102,15 @@ static int stream_filtered(const struct wim_lookup_table_entry *lte, const struct filter_context *ctx) { - int write_flags = ctx->write_flags; - WIMStruct *wim = ctx->wim; + int write_flags; + WIMStruct *wim; if (ctx == NULL) return 0; + write_flags = ctx->write_flags; + wim = ctx->wim; + if (write_flags & WIMLIB_WRITE_FLAG_OVERWRITE && lte->resource_location == RESOURCE_IN_WIM && lte->rspec->wim == wim) -- 2.43.0