Fixed defects
List of Defects
Error: COMPILER_WARNING (CWE-195): [#def1]
snappy-1.1.10-build/snappy-1.1.10/snappy.cc:1293:37: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘ptrdiff_t’ {aka ‘long int’}
# 1293 | (op + deferred_length) < op_limit_min_slop);
# | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
snappy-1.1.10-build/snappy-1.1.10/snappy.cc: scope_hint: In instantiation of ‘std::pair<const unsigned char*, long int> snappy::DecompressBranchless(const uint8_t*, const uint8_t*, ptrdiff_t, T, ptrdiff_t) [with T = long unsigned int; uint8_t = unsigned char; ptrdiff_t = long int]’
#/builddir/build/BUILD/snappy-1.1.10-build/snappy-1.1.10/snappy.cc:1405:35: required from ‘void snappy::SnappyDecompressor::DecompressAllTags(Writer*) [with Writer = snappy::SnappyDecompressionValidator]’
# 1405 | DecompressBranchless(reinterpret_cast<const uint8_t*>(ip),
# | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1406 | reinterpret_cast<const uint8_t*>(ip_limit_),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1407 | op - op_base, op_base, op_limit_min_slop);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1600 | decompressor->DecompressAllTags(writer);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
#/builddir/build/BUILD/snappy-1.1.10-build/snappy-1.1.10/snappy.cc:1587:35: required from ‘bool snappy::InternalUncompress(Source*, Writer*) [with Writer = SnappyDecompressionValidator]’
# 1587 | return InternalUncompressAllTags(&decompressor, writer, r->Available(),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1588 | uncompressed_len);
# | ~~~~~~~~~~~~~~~~~
# 2101 | return InternalUncompress(&reader, &writer);
# | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
# 1291| }
# 1292| } while (ip < ip_limit_min_slop &&
# 1293|-> (op + deferred_length) < op_limit_min_slop);
# 1294| exit:
# 1295| ip--;
Error: COMPILER_WARNING (CWE-195): [#def2]
snappy-1.1.10-build/snappy-1.1.10/snappy.cc: scope_hint: In function ‘constexpr bool snappy::VerifyCalculateNeeded()’
snappy-1.1.10-build/snappy-1.1.10/snappy.cc:1508:28: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’
# 1508 | if (CalculateNeeded(i) != (char_table[i] >> 11) + 1) return false;
# | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
snappy-1.1.10-build/snappy-1.1.10/snappy.cc: scope_hint: In instantiation of ‘std::pair<const unsigned char*, long int> snappy::DecompressBranchless(const uint8_t*, const uint8_t*, ptrdiff_t, T, ptrdiff_t) [with T = char*; uint8_t = unsigned char; ptrdiff_t = long int]’
#/builddir/build/BUILD/snappy-1.1.10-build/snappy-1.1.10/snappy.cc:1405:35: required from ‘void snappy::SnappyDecompressor::DecompressAllTags(Writer*) [with Writer = snappy::SnappyArrayWriter]’
# 1405 | DecompressBranchless(reinterpret_cast<const uint8_t*>(ip),
# | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1406 | reinterpret_cast<const uint8_t*>(ip_limit_),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1407 | op - op_base, op_base, op_limit_min_slop);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1600 | decompressor->DecompressAllTags(writer);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
#/builddir/build/BUILD/snappy-1.1.10-build/snappy-1.1.10/snappy.cc:2415:44: required from here
# 2415 | bool result = InternalUncompressAllTags(&decompressor, &writer,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# 2416 | compressed_len, uncompressed_len);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1506| constexpr bool VerifyCalculateNeeded() {
# 1507| for (int i = 0; i < 1; i++) {
# 1508|-> if (CalculateNeeded(i) != (char_table[i] >> 11) + 1) return false;
# 1509| }
# 1510| return true;
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
diffbase-analyzer-version-clang | 18.1.7 |
diffbase-analyzer-version-cppcheck | 2.14.2 |
diffbase-analyzer-version-gcc | 14.1.1 |
diffbase-analyzer-version-gcc-analyzer | 14.1.1 |
diffbase-analyzer-version-shellcheck | 0.10.0 |
diffbase-enabled-plugins | clang, cppcheck, gcc, shellcheck |
diffbase-exit-code | 0 |
diffbase-host | ip-172-16-1-88.us-west-2.compute.internal |
diffbase-mock-config | fedora-41-x86_64 |
diffbase-project-name | snappy-1.2.1-1.fc41 |
diffbase-store-results-to | /tmp/tmpkw1zu_4x/snappy-1.2.1-1.fc41.tar.xz |
diffbase-time-created | 2024-07-03 17:58:40 |
diffbase-time-finished | 2024-07-03 17:59:55 |
diffbase-tool | csmock |
diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpkw1zu_4x/snappy-1.2.1-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpkw1zu_4x/snappy-1.2.1-1.fc41.src.rpm' |
diffbase-tool-version | csmock-3.5.3-1.el9 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-88.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | snappy-1.1.10-4.fc40 |
store-results-to | /tmp/tmpmnogzbhm/snappy-1.1.10-4.fc40.tar.xz |
time-created | 2024-07-03 17:56:57 |
time-finished | 2024-07-03 17:58:33 |
title | Fixed defects |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpmnogzbhm/snappy-1.1.10-4.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpmnogzbhm/snappy-1.1.10-4.fc40.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |