diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59370f5b..e4f6258e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,7 +181,7 @@ jobs: CC: gcc # This is required to use a version of cppcheck other than that # supplied with the operating system - CPPCHECK_VER: "2.17.1" + CPPCHECK_VER: "2.18.0" CPPCHECK_REPO: https://github.com/danmar/cppcheck.git steps: # Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20') diff --git a/scripts/run_cppcheck.sh b/scripts/run_cppcheck.sh index a11a565f..4080b6c6 100755 --- a/scripts/run_cppcheck.sh +++ b/scripts/run_cppcheck.sh @@ -86,6 +86,7 @@ if [ -z "$CPPCHECK_FLAGS" ]; then CPPCHECK_FLAGS="--quiet --force --std=c11 --std=c++11 --inline-suppr \ --enable=warning --error-exitcode=1 -i third_party \ --suppress=uninitMemberVar:ulalaca/ulalaca.cpp \ + --suppress=dangerousTypeCast:ulalaca/XrdpStream.template.cpp \ --suppress=shiftTooManyBits:libxrdp/xrdp_mppc_enc.c" # Check for flags added in later versions diff --git a/xrdp/xrdp_tconfig.c b/xrdp/xrdp_tconfig.c index 5fc475be..058f5cce 100644 --- a/xrdp/xrdp_tconfig.c +++ b/xrdp/xrdp_tconfig.c @@ -225,6 +225,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, datum.u.s, sizeof(param[connection_type].preset) - 1); free(datum.u.s); + datum.u.s = NULL; } else if (connection_type == 0) { @@ -245,6 +246,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, datum.u.s, sizeof(param[connection_type].tune) - 1); free(datum.u.s); + datum.u.s = NULL; } else if (connection_type == 0) { @@ -265,6 +267,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, datum.u.s, sizeof(param[connection_type].profile) - 1); free(datum.u.s); + datum.u.s = NULL; // Prevent double-free warning with cppcheck 2.18.0 } else if (connection_type == 0) {