]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Avoid possibility dereference of null pointer.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 9 Nov 2009 07:58:11 +0000 (02:58 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 9 Nov 2009 07:58:11 +0000 (02:58 -0500)
Found by Clang Static Analyzer.

SVN-Revision: 1624

libarchive/archive_read_support_compression_uu.c

index ee844ce2743f50ab6245f8dd093812f054722b9f..89f8c03a4128156a1fb930c3cfaf7c570855bb4d 100644 (file)
@@ -417,6 +417,10 @@ read_more:
        d = __archive_read_filter_ahead(self->upstream, 1, &avail_in);
        if (d == NULL && avail_in < 0)
                return (ARCHIVE_FATAL);
+       /* Quiet a code analyzer; make sure avail_in must be zero
+        * when d is NULL. */
+       if (d == NULL)
+               avail_in = 0;
        used = 0;
        total = 0;
        out = uudecode->out_buff;