]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Avoid the error which Clang Static Analyzer says "Null pointer argument in call to...
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 27 Feb 2012 10:26:36 +0000 (19:26 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 27 Feb 2012 10:26:36 +0000 (19:26 +0900)
libarchive/archive_read_support_format_tar.c

index b044fc9780363cec6a8924ab122bf05f574bc489..4538331f3d05382a8e129c0e326fe9684a40bf8a 100644 (file)
@@ -1665,6 +1665,9 @@ pax_attribute(struct archive_read *a, struct tar *tar,
        long n;
        int err = ARCHIVE_OK, r;
 
+       if (value == NULL)
+               value = "";     /* Disable compiler warning; do not pass
+                                * NULL pointer to strlen().  */
        switch (key[0]) {
        case 'G':
                /* GNU "0.0" sparse pax format. */