Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-563): [#def1]
cmake-3.28.3-build/cmake-3.28.3/Source/cmGeneratorTarget.cxx: scope_hint: In function ‘void {anonymous}::addFileSetEntry(const cmGeneratorTarget*, const std::string&, cmGeneratorExpressionDAGChecker*, const cmFileSet*, EvaluatedTargetPropertyEntries&)’
cmake-3.28.3-build/cmake-3.28.3/Source/cmGeneratorTarget.cxx:1640:10: warning[-Wunused-variable]: unused variable ‘cm’
# 1640 |   cmake* cm = headTarget->GetLocalGenerator()->GetCMakeInstance();
#      |          ^~
# 1638|       }
# 1639|     }
# 1640|->   cmake* cm = headTarget->GetLocalGenerator()->GetCMakeInstance();
# 1641|     for (auto& entryCge : fileSet->CompileFileEntries()) {
# 1642|       TargetPropertyEntryFileSet tpe(dirs, contextSensitiveDirs,

Error: COMPILER_WARNING: [#def2]
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/md5.c:208:51: warning[-Warray-parameter=]: argument 2 of type ‘unsigned char *’ declared as a pointer
#  208 | void rhash_md5_final(md5_ctx* ctx, unsigned char* result)
#      |                                    ~~~~~~~~~~~~~~~^~~~~~
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/md5.c:19: included_from: Included from here.
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/md5.h:25:50: note: previously declared as an array ‘unsigned char[16]’
#   25 | void rhash_md5_final(md5_ctx* ctx, unsigned char result[16]);
#      |                                    ~~~~~~~~~~~~~~^~~~~~~~~~
#  206|    * @param result calculated hash in binary form
#  207|    */
#  208|-> void rhash_md5_final(md5_ctx* ctx, unsigned char* result)
#  209|   {
#  210|   	unsigned index = ((unsigned)ctx->length & 63) >> 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c: scope_hint: In function ‘rhash_init’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:153:16: warning[-Wanalyzer-malloc-leak]: leak of ‘rctx’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/algorithms.h:6: included_from: Included from here.
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:30: included_from: Included from here.
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:82:26: note: in expansion of macro ‘rhash_ctz’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:34: included_from: Included from here.
#  151|   	}
#  152|   
#  153|-> 	return &rctx->rc; /* return allocated and initialized rhash context */
#  154|   }
#  155|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c: scope_hint: In function ‘rhash_final’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:232:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:82:26: note: in expansion of macro ‘rhash_ctz’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c: scope_hint: In function ‘rhash_final’
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c: scope_hint: In function ‘rhash_final’
#  230|   	for (i = 0; i < ectx->hash_vector_size; i++) {
#  231|   		struct rhash_hash_info* info = ectx->vector[i].hash_info;
#  232|-> 		assert(info->final != 0);
#  233|   		assert(info->info->digest_size < sizeof(buffer));
#  234|   		info->final(ectx->vector[i].context, out);

Error: CPPCHECK_WARNING (CWE-682): [#def5]
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/rhash.c:329: error[nullPointerArithmetic]: Overflow in pointer arithmetic, NULL pointer is subtracted.
#  327|   	if (!pmem) return -1; /* errno is set to ENOMEM according to UNIX 98 */
#  328|   
#  329|-> 	align8 = ((unsigned char*)0 - pmem) & 7;
#  330|   	buffer = pmem + align8;
#  331|   

Error: COMPILER_WARNING: [#def6]
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/sha256.c:213:57: warning[-Warray-parameter=]: argument 2 of type ‘unsigned char *’ declared as a pointer
#  213 | void rhash_sha256_final(sha256_ctx* ctx, unsigned char* result)
#      |                                          ~~~~~~~~~~~~~~~^~~~~~
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/sha256.c:20: included_from: Included from here.
cmake-3.28.3-build/cmake-3.28.3/Utilities/cmlibrhash/librhash/sha256.h:26:56: note: previously declared as an array ‘unsigned char[32]’
#   26 | void rhash_sha256_final(sha256_ctx* ctx, unsigned char result[32]);
#      |                                          ~~~~~~~~~~~~~~^~~~~~~~~~
#  211|    * @param result calculated hash in binary form
#  212|    */
#  213|-> void rhash_sha256_final(sha256_ctx* ctx, unsigned char* result)
#  214|   {
#  215|   	size_t index = ((unsigned)ctx->length & 63) >> 2;

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-27.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namecmake-3.30.5-1.fc42
diffbase-store-results-to/tmp/tmp351tpknn/cmake-3.30.5-1.fc42.tar.xz
diffbase-time-created2024-11-12 23:56:13
diffbase-time-finished2024-11-13 00:25:33
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp351tpknn/cmake-3.30.5-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp351tpknn/cmake-3.30.5-1.fc42.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-27.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namecmake-3.28.3-7.fc41
store-results-to/tmp/tmpe80yz7e1/cmake-3.28.3-7.fc41.tar.xz
time-created2024-11-12 23:28:48
time-finished2024-11-12 23:55:57
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpe80yz7e1/cmake-3.28.3-7.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpe80yz7e1/cmake-3.28.3-7.fc41.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9