From: Michihiro NAKAJIMA Date: Fri, 6 Apr 2012 03:38:47 +0000 (+0900) Subject: Avoid a warning that Clang Static Analyzer complained X-Git-Tag: v3.1.0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee1715903b6071f0eee48c2f5f86912a8f22e349;p=thirdparty%2Flibarchive.git Avoid a warning that Clang Static Analyzer complained "Access to field 'unconsumed' results in a dereference of a null pointer (loaded from field 'entry_cfdata." --- diff --git a/libarchive/archive_read_support_format_cab.c b/libarchive/archive_read_support_format_cab.c index aa0152a17..b6f08b4dd 100644 --- a/libarchive/archive_read_support_format_cab.c +++ b/libarchive/archive_read_support_format_cab.c @@ -2001,7 +2001,8 @@ archive_read_format_cab_read_data_skip(struct archive_read *a) /* If the compression type is none(uncompressed), we've already * consumed data as much as the current entry size. */ - if (cab->entry_cffolder->comptype == COMPTYPE_NONE) + if (cab->entry_cffolder->comptype == COMPTYPE_NONE && + cab->entry_cfdata != NULL) cab->entry_cfdata->unconsumed = 0; /* This entry is finished and done. */