Newly introduced findings

List of Findings

Error: COMPILER_WARNING (CWE-195): [#def1]
tesseract-5.5.3/src/ccutil/unicharcompress.cpp: scope_hint: In member function ‘bool tesseract::UnicharCompress::ComputeEncoding(const tesseract::UNICHARSET&, int, std::string*)’
tesseract-5.5.3/src/ccutil/unicharcompress.cpp:212:26: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’
#  212 |       if (code->length() <= i) {
#      |           ~~~~~~~~~~~~~~~^~~~
#  210|       for (unsigned u = 0; u < unicharset.size(); ++u) {
#  211|         RecodedCharID *code = &encoder_[u];
#  212|->       if (code->length() <= i) {
#  213|           continue;
#  214|         }

Error: COMPILER_WARNING (CWE-195): [#def2]
tesseract-5.5.3/src/ccutil/unicharcompress.cpp: scope_hint: In member function ‘void tesseract::UnicharCompress::DefragmentCodeValues(int)’
tesseract-5.5.3/src/ccutil/unicharcompress.cpp:285:23: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’}
#  285 |     for (int i = 0; i < code->length(); ++i) {
#      |                     ~~^~~~~~~~~~~~~~~~
#  283|     for (auto &c : encoder_) {
#  284|       RecodedCharID *code = &c;
#  285|->     for (int i = 0; i < code->length(); ++i) {
#  286|         int value = (*code)(i);
#  287|         code->Set(i, value + offsets[value]);

Error: COMPILER_WARNING (CWE-1023): [#def3]
tesseract-5.5.3/src/classify/cluster.cpp: scope_hint: In function ‘float tesseract::StandardDeviation(PROTOTYPE*, uint16_t)’
tesseract-5.5.3/src/classify/cluster.cpp:1688:5: warning[-Wswitch]: case value ‘-2’ not in enumerated type ‘tesseract::PROTOSTYLE’
# 1688 |     case PROTOSTYLE::mixed:
#      |     ^~~~
# 1686|       case PROTOSTYLE::elliptical:
# 1687|         return std::sqrt(Proto->Variance.Elliptical[Dimension]);
# 1688|->     case PROTOSTYLE::mixed:
# 1689|         switch (Proto->Distrib[Dimension]) {
# 1690|           case DISTRIBUTION::normal:

Error: CPPCHECK_WARNING (CWE-457): [#def4]
tesseract-5.5.3/src/classify/cluster.cpp:2688: error[legacyUninitvar]: Uninitialized variable: DensityFunction
# 2686|   
# 2687|       Probability = 0.0;
# 2688|->     LastProbDensity = (*DensityFunction[static_cast<int>(Distribution)])(BUCKETTABLESIZE / 2);
# 2689|       for (i = BUCKETTABLESIZE / 2; i < BUCKETTABLESIZE; i++) {
# 2690|         ProbDensity = (*DensityFunction[static_cast<int>(Distribution)])(i + 1);

Error: COMPILER_WARNING (CWE-1023): [#def5]
tesseract-5.5.3/src/classify/clusttool.cpp:284:10: warning[-Wswitch]: enumeration value ‘automatic’ not handled in switch
#  282|     fprintf(File, "\t");
#  283|   
#  284|->   switch (Proto->Style) {
#  285|       case PROTOSTYLE::spherical:
#  286|         WriteNFloats(File, 1, &(Proto->Variance.Spherical));

Error: COMPILER_WARNING (CWE-1023): [#def6]
tesseract-5.5.3/src/classify/clusttool.cpp: scope_hint: In function ‘void tesseract::WritePrototype(FILE*, uint16_t, PROTOTYPE*)’
tesseract-5.5.3/src/classify/clusttool.cpp:284:10: warning[-Wswitch]: enumeration value ‘mixed’ not handled in switch
#  284 |   switch (Proto->Style) {
#      |          ^
#  282|     fprintf(File, "\t");
#  283|   
#  284|->   switch (Proto->Style) {
#  285|       case PROTOSTYLE::spherical:
#  286|         WriteNFloats(File, 1, &(Proto->Variance.Spherical));

Error: COMPILER_WARNING (CWE-1023): [#def7]
tesseract-5.5.3/src/classify/clusttool.cpp:291:5: warning[-Wswitch]: case value ‘-1’ not in enumerated type ‘tesseract::PROTOSTYLE’
#  291 |     case PROTOSTYLE::automatic:
#      |     ^~~~
#  289|         WriteNFloats(File, N, Proto->Variance.Elliptical);
#  290|         break;
#  291|->     case PROTOSTYLE::automatic:
#  292|         break;
#  293|       case PROTOSTYLE::mixed:

Error: COMPILER_WARNING (CWE-1023): [#def8]
tesseract-5.5.3/src/classify/clusttool.cpp:293:5: warning[-Wswitch]: case value ‘-2’ not in enumerated type ‘tesseract::PROTOSTYLE’
#  293 |     case PROTOSTYLE::mixed:
#      |     ^~~~
#  291|       case PROTOSTYLE::automatic:
#  292|         break;
#  293|->     case PROTOSTYLE::mixed:
#  294|         for (i = 0; i < N; i++) {
#  295|           switch (Proto->Distrib[i]) {

Error: COMPILER_WARNING (CWE-195): [#def9]
tesseract-5.5.3/src/classify/intproto.cpp: scope_hint: In function ‘void tesseract::AddIntClass(INT_TEMPLATES_STRUCT*, CLASS_ID, INT_CLASS_STRUCT*)’
tesseract-5.5.3/src/classify/intproto.cpp:235:29: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’
#  235 |   if (Templates->NumClasses > MaxNumClassesIn(Templates)) {
#      |       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  233|     Templates->NumClasses++;
#  234|   
#  235|->   if (Templates->NumClasses > MaxNumClassesIn(Templates)) {
#  236|       Pruner = Templates->NumClassPruners++;
#  237|       Templates->ClassPruners[Pruner] = new CLASS_PRUNER_STRUCT;

Error: COMPILER_WARNING (CWE-195): [#def10]
tesseract-5.5.3/src/classify/intproto.cpp: scope_hint: In member function ‘tesseract::INT_TEMPLATES_STRUCT* tesseract::Classify::ReadIntTemplates(tesseract::TFile*)’
tesseract-5.5.3/src/classify/intproto.cpp:791:89: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’
#  791 |       if (fp->FRead(&Class->ProtoLengths[0], sizeof(uint8_t), MaxNumIntProtosIn(Class)) !=
#      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
#  792 |           MaxNumIntProtosIn(Class)) {
#      |           ~~~~~~~~~~~~~~~~~~~~~~~~                                                       
#  789|       if (MaxNumIntProtosIn(Class) > 0) {
#  790|         Class->ProtoLengths.resize(MaxNumIntProtosIn(Class));
#  791|->       if (fp->FRead(&Class->ProtoLengths[0], sizeof(uint8_t), MaxNumIntProtosIn(Class)) !=
#  792|             MaxNumIntProtosIn(Class)) {
#  793|           tprintf("Bad read of inttemp!\n");

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-134.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nametesseract-5.5.2-1.fc44
diffbase-store-results-to/tmp/tmpood03d3g/tesseract-5.5.2-1.fc44.tar.xz
diffbase-time-created2026-08-03 21:12:30
diffbase-time-finished2026-08-03 21:21:33
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpood03d3g/tesseract-5.5.2-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpood03d3g/tesseract-5.5.2-1.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-134.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nametesseract-5.5.3-1.fc45
store-results-to/tmp/tmp7ebxgm64/tesseract-5.5.3-1.fc45.tar.xz
time-created2026-08-03 21:21:43
time-finished2026-08-03 21:30:02
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp7ebxgm64/tesseract-5.5.3-1.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp7ebxgm64/tesseract-5.5.3-1.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9