]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix possible NULL pointer dereference (#433)
authorIgor Pylypiv <igor.pylypiv@gmail.com>
Mon, 10 Jun 2019 20:52:35 +0000 (13:52 -0700)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 22 Oct 2019 18:30:01 +0000 (20:30 +0200)
cppcheck:
  [src/manifest.c:270] -> [src/manifest.c:269]: (warning)
  Either the condition '!errmsg' is redundant or there is possible null pointer
  dereference: errmsg.

(cherry picked from commit 359be01b408ba4c60b968575ee6382ec5483f69f)

src/manifest.c

index 0b85e90686a87415fb4bd6baddd1d41bc50ca0c6..603d85bbd1864679b3d90387d1ccbf0a6e55f9e1 100644 (file)
@@ -288,7 +288,7 @@ read_manifest(gzFile f, char **errmsg)
        return mf;
 
 error:
-       if (!errmsg) {
+       if (!*errmsg) {
                *errmsg = x_strdup("Corrupt manifest file");
        }
        free_manifest(mf);