diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38c0efaa..eda0889a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,8 +126,8 @@ jobs: env: CC: gcc # This is required to use a version of cppcheck other than that - # suplied with the operating system - CPPCHECK_VER: 2.1 + # supplied with the operating system + CPPCHECK_VER: 2.3 CPPCHECK_REPO: https://github.com/danmar/cppcheck.git steps: - uses: actions/checkout@v2 @@ -142,4 +142,3 @@ jobs: - run: ./bootstrap - run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER - run: scripts/run_cppcheck.sh -v $CPPCHECK_VER - \ No newline at end of file diff --git a/common/pixman-region.c b/common/pixman-region.c index ccdea9ad..8896b241 100644 --- a/common/pixman-region.c +++ b/common/pixman-region.c @@ -1799,7 +1799,10 @@ validate (region_type_t * badreg) *badreg = ri[0].reg; if (ri != stack_regions) + { + /* cppcheck-suppress autovarInvalidDeallocation */ free (ri); + } GOOD (badreg); return ret; @@ -1809,7 +1812,10 @@ bail: FREE_DATA (&ri[i].reg); if (ri != stack_regions) + { + /* cppcheck-suppress autovarInvalidDeallocation */ free (ri); + } return pixman_break (badreg); } diff --git a/scripts/install_cppcheck.sh b/scripts/install_cppcheck.sh index ef6eecd4..8aa34790 100755 --- a/scripts/install_cppcheck.sh +++ b/scripts/install_cppcheck.sh @@ -129,6 +129,12 @@ fi make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR CFGDIR=$FILESDIR" ;; *) make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR USE_Z3=yes" + # Check that the Z3 development files appear to be installed + # before trying to create z3_version.h. Otherwise we may + # mislead the user as to what needs to be done. + if [ ! -f /usr/include/z3.h ]; then + echo "** libz3-dev (or equivalent) does not appear to be installed" >&2 + fi if [ ! -f /usr/include/z3_version.h ]; then create_z3_version_h fi diff --git a/sesman/chansrv/chansrv_xfs.c b/sesman/chansrv/chansrv_xfs.c index 3c0976da..0f411957 100644 --- a/sesman/chansrv/chansrv_xfs.c +++ b/sesman/chansrv/chansrv_xfs.c @@ -273,7 +273,11 @@ xfs_create_xfs_fs(mode_t umask, uid_t uid, gid_t gid) xfs->free_list = NULL; xfs->generation = 1; + /* xfs->inode_table check should be superfluous here, but it + * prevents cppcheck 2.2/2.3 generating a false positive nullPointer + * report */ if (!grow_xfs(xfs, INODE_TABLE_ALLOCATION_INITIAL) || + xfs->inode_table == NULL || (xino1 = g_new0(XFS_INODE_ALL, 1)) == NULL || (xino2 = g_new0(XFS_INODE_ALL, 1)) == NULL) {