libdmtx-0.7.8-1.fc43

List of Findings

Error: COMPILER_WARNING (CWE-483): [#def1]
libdmtx-0.7.8/dmtx.c:68: included_from: Included from here.
libdmtx-0.7.8/dmtxencodec40textx12.c: scope_hint: In function 'EncodeNextChunkCTX'
libdmtx-0.7.8/dmtxencodec40textx12.c:51:14: warning[-Wmisleading-indentation]: this 'for' clause does not guard...
#   51 |              for(i = 0; i < valueList.length % 3; i++)
#      |              ^~~
libdmtx-0.7.8/dmtxencodec40textx12.c:18:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
#   18 | #define CHKERR { if(stream->status != DmtxStatusEncoding) { return; } }
#      |                ^
libdmtx-0.7.8/dmtxencodec40textx12.c:52:49: note: in expansion of macro 'CHKERR'
#   52 |                 StreamInputAdvancePrev(stream); CHKERR;
#      |                                                 ^~~~~~
#   49|                /* X12 does not allow partial blocks, resend last 1 or 2 as ASCII */
#   50|                EncodeChangeScheme(stream, DmtxSchemeAscii, DmtxUnlatchExplicit); CHKERR;
#   51|->              for(i = 0; i < valueList.length % 3; i++)
#   52|                   StreamInputAdvancePrev(stream); CHKERR;
#   53|   

Error: COMPILER_WARNING (CWE-483): [#def2]
libdmtx-0.7.8/dmtxencodec40textx12.c: scope_hint: In function 'CompletePartialC40Text'
libdmtx-0.7.8/dmtxencodec40textx12.c:270:7: warning[-Wmisleading-indentation]: this 'if' clause does not guard...
#  270 |       if(valueList->length == 2 && outputTmp.length == 1)
#      |       ^~
libdmtx-0.7.8/dmtxencodec40textx12.c:18:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
#   18 | #define CHKERR { if(stream->status != DmtxStatusEncoding) { return; } }
#      |                ^
libdmtx-0.7.8/dmtxencodec40textx12.c:271:42: note: in expansion of macro 'CHKERR'
#  271 |          StreamInputAdvancePrev(stream); CHKERR;
#      |                                          ^~~~~~
#  268|         /* Test-encode most recently consumed input value to C40/Text/X12 */
#  269|         PushCTXValues(&outputTmp, inputValue, stream->currentScheme, &passFail, stream->fnc1);
#  270|->       if(valueList->length == 2 && outputTmp.length == 1)
#  271|            StreamInputAdvancePrev(stream); CHKERR;
#  272|   

Error: COMPILER_WARNING (CWE-483): [#def3]
libdmtx-0.7.8/dmtxencodec40textx12.c:298:10: warning[-Wmisleading-indentation]: this 'for' clause does not guard...
#  298 |          for(i = 0; i < outputTmp.length; i++)
#      |          ^~~
libdmtx-0.7.8/dmtxencodec40textx12.c:18:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
#   18 | #define CHKERR { if(stream->status != DmtxStatusEncoding) { return; } }
#      |                ^
libdmtx-0.7.8/dmtxencodec40textx12.c:299:55: note: in expansion of macro 'CHKERR'
#  299 |             AppendValueAscii(stream, outputTmp.b[i]); CHKERR;
#      |                                                       ^~~~~~
#  296|            /* Finish in ASCII (c) */
#  297|            EncodeChangeScheme(stream, DmtxSchemeAscii, DmtxUnlatchExplicit); CHKERR;
#  298|->          for(i = 0; i < outputTmp.length; i++)
#  299|               AppendValueAscii(stream, outputTmp.b[i]); CHKERR;
#  300|   

Error: COMPILER_WARNING (CWE-483): [#def4]
libdmtx-0.7.8/dmtxencodec40textx12.c: scope_hint: In function 'CompletePartialX12'
libdmtx-0.7.8/dmtxencodec40textx12.c:362:7: warning[-Wmisleading-indentation]: this 'for' clause does not guard...
#  362 |       for(i = 0; i < outputTmp.length; i++)
#      |       ^~~
libdmtx-0.7.8/dmtxencodec40textx12.c:18:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
#   18 | #define CHKERR { if(stream->status != DmtxStatusEncoding) { return; } }
#      |                ^
libdmtx-0.7.8/dmtxencodec40textx12.c:363:52: note: in expansion of macro 'CHKERR'
#  363 |          AppendValueAscii(stream, outputTmp.b[i]); CHKERR;
#      |                                                    ^~~~~~
#  360|         /* Finish in ASCII (XXX) */
#  361|         EncodeChangeScheme(stream, DmtxSchemeAscii, DmtxUnlatchExplicit); CHKERR;
#  362|->       for(i = 0; i < outputTmp.length; i++)
#  363|            AppendValueAscii(stream, outputTmp.b[i]); CHKERR;
#  364|   

Error: COMPILER_WARNING (CWE-483): [#def5]
libdmtx-0.7.8/dmtx.c:65: included_from: Included from here.
libdmtx-0.7.8/dmtxencodescheme.c: scope_hint: In function 'EncodeNextChunk'
libdmtx-0.7.8/dmtxencodescheme.c:150:4: warning[-Wmisleading-indentation]: this 'if' clause does not guard...
#  150 |    if(scheme == DmtxSchemeEdifact)
#      |    ^~
libdmtx-0.7.8/dmtxencodescheme.c:74:16: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
#   74 | #define CHKERR { \
#      |                ^
libdmtx-0.7.8/dmtxencodescheme.c:151:54: note: in expansion of macro 'CHKERR'
#  151 |       CompleteIfDoneEdifact(stream, sizeIdxRequest); CHKERR;
#      |                                                      ^~~~~~
#  148|   
#  149|      /* Special case: Edifact may be done before writing first word */
#  150|->    if(scheme == DmtxSchemeEdifact)
#  151|         CompleteIfDoneEdifact(stream, sizeIdxRequest); CHKERR;
#  152|   

Error: CPPCHECK_WARNING (CWE-457): [#def6]
libdmtx-0.7.8/dmtxencodestream.c:37: error[uninitvar]: Uninitialized variable: stream.fnc1
#   35|      stream.status = DmtxStatusEncoding;
#   36|   
#   37|->    return stream;
#   38|   }
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libdmtx-0.7.8/dmtximage.c:88:4: warning[-Wanalyzer-malloc-leak]: leak of 'img'
libdmtx-0.7.8/dmtximage.c:68:6: branch_false: following 'false' branch...
libdmtx-0.7.8/dmtximage.c:71:23: acquire_memory: allocated here
libdmtx-0.7.8/dmtximage.c:72:6: branch_false: following 'false' branch (when 'img' is non-NULL)...
libdmtx-0.7.8/dmtximage.c:75:4: branch_false: ...to here
libdmtx-0.7.8/dmtximage.c:88:4: danger: 'img' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   86|      img->channelCount = 0;
#   87|   
#   88|->    switch(pack) {
#   89|         case DmtxPackCustom:
#   90|            break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libdmtx-0.7.8/dmtximage.c:179:4: warning[-Wanalyzer-malloc-leak]: leak of 'img'
libdmtx-0.7.8/dmtximage.c:63:1: enter_function: entry to 'dmtxImageCreate'
libdmtx-0.7.8/dmtximage.c:68:6: branch_false: following 'false' branch...
libdmtx-0.7.8/dmtximage.c:71:23: acquire_memory: allocated here
libdmtx-0.7.8/dmtximage.c:72:6: branch_false: following 'false' branch (when 'img' is non-NULL)...
libdmtx-0.7.8/dmtximage.c:75:4: branch_false: ...to here
libdmtx-0.7.8/dmtximage.c:92:10: call_function: calling 'dmtxImageSetChannel' from 'dmtxImageCreate'
libdmtx-0.7.8/dmtximage.c:92:10: return_function: returning to 'dmtxImageCreate' from 'dmtxImageSetChannel'
libdmtx-0.7.8/dmtximage.c:179:4: danger: 'img' leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  177|      img->bitsPerChannel[img->channelCount] = bitsPerChannel;
#  178|      img->channelStart[img->channelCount] = channelStart;
#  179|->    (img->channelCount)++;
#  180|   
#  181|      return DmtxPass;

Error: CPPCHECK_WARNING (CWE-457): [#def9]
libdmtx-0.7.8/dmtxregion.c:223: warning[uninitvar]: Uninitialized variables: flowPlane.plane, flowPlane.arrive, flowPlane.depart, flowPlane.mag, flowPlane.loc
#  221|      }
#  222|   
#  223|->    if(flowPlane[strongIdx].mag < 10)
#  224|         return dmtxBlankEdge;
#  225|   

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-114.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibdmtx-0.7.8-1.fc43
store-results-to/tmp/tmpw3btgmd7/libdmtx-0.7.8-1.fc43.tar.xz
time-created2025-04-25 13:51:28
time-finished2025-04-25 13:52:50
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpw3btgmd7/libdmtx-0.7.8-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpw3btgmd7/libdmtx-0.7.8-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9