From: Eric Biggers Date: Tue, 5 Aug 2014 01:46:24 +0000 (-0500) Subject: write.c: Fix handling of NULL context in stream_filtered() X-Git-Tag: v1.7.1~12 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=105b46dcfa04b92674bf0c18f93f9438d8d9ef9a 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. --- 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)