]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Avoid a warning that Clang Static Analyzer complained
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Fri, 6 Apr 2012 03:38:47 +0000 (12:38 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Fri, 6 Apr 2012 03:55:51 +0000 (12:55 +0900)
"Access to field 'unconsumed' results in a dereference of a null
 pointer (loaded from field 'entry_cfdata."

libarchive/archive_read_support_format_cab.c

index aa0152a1714099fb0990414b5a287d2192adc730..b6f08b4ddde6a93d30b9bf578a07ea306a9edd3c 100644 (file)
@@ -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. */