Newly introduced findings

List of Findings

Error: COMPILER_WARNING (CWE-563): [#def1]
leptonica-1.85.0-build/leptonica-1.85.0/prog/cleanpdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/cleanpdf.c:139:45: warning[-Wunused-variable]: unused variable ‘render_res’
#  139 | l_int32  res, contrast, rotation, opensize, render_res;
#      |                                             ^~~~~~~~~~
#  137|   {
#  138|   char    *basedir, *title, *fileout;
#  139|-> l_int32  res, contrast, rotation, opensize, render_res;
#  140|   SARRAY  *safiles;
#  141|   

Error: COMPILER_WARNING (CWE-563): [#def2]
leptonica-1.85.0-build/leptonica-1.85.0/prog/compresspdf.c:118:12: warning[-Wunused-variable]: unused variable ‘buf’
#  118 | char       buf[256];
#      |            ^~~
#  116|                char **argv)
#  117|   {
#  118|-> char       buf[256];
#  119|   char      *basedir, *title, *fileout;
#  120|   l_int32    imres, render_res, onebit, savecolor, quality;

Error: COMPILER_WARNING (CWE-563): [#def3]
leptonica-1.85.0-build/leptonica-1.85.0/prog/compresspdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/compresspdf.c:120:19: warning[-Wunused-variable]: unused variable ‘render_res’
#  120 | l_int32    imres, render_res, onebit, savecolor, quality;
#      |                   ^~~~~~~~~~
#  118|   char       buf[256];
#  119|   char      *basedir, *title, *fileout;
#  120|-> l_int32    imres, render_res, onebit, savecolor, quality;
#  121|   l_float32  scalefactor;
#  122|   SARRAY    *safiles;

Error: COMPILER_WARNING (CWE-563): [#def4]
leptonica-1.85.0-build/leptonica-1.85.0/prog/croppdf.c:111:12: warning[-Wunused-variable]: unused variable ‘buf’
#  111 | char       buf[256];
#      |            ^~~
#  109|                char **argv)
#  110|   {
#  111|-> char       buf[256];
#  112|   char      *basedir, *title, *fileout;
#  113|   l_int32    lrclear, tbclear, edgeclean, lrborder, tbborder;

Error: COMPILER_WARNING (CWE-563): [#def5]
leptonica-1.85.0-build/leptonica-1.85.0/prog/croppdf.c: scope_hint: In function ‘main’
leptonica-1.85.0-build/leptonica-1.85.0/prog/croppdf.c:114:24: warning[-Wunused-variable]: unused variable ‘render_res’
#  114 | l_int32    printwiden, render_res;
#      |                        ^~~~~~~~~~
#  112|   char      *basedir, *title, *fileout;
#  113|   l_int32    lrclear, tbclear, edgeclean, lrborder, tbborder;
#  114|-> l_int32    printwiden, render_res;
#  115|   l_float32  maxwiden;
#  116|   SARRAY    *safiles;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c: scope_hint: In function ‘pixReadMemBmp’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:150:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cmapBuf’
leptonica-1.85.0-build/leptonica-1.85.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:47: included_from: Included from here.
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:255:35: note: in expansion of macro ‘LEPT_CALLOC’
leptonica-1.85.0-build/leptonica-1.85.0/src/bmpio.c:255:35: note: in expansion of macro ‘LEPT_CALLOC’
#  148|   
#  149|       if (!cdata)
#  150|->         return (PIX *)ERROR_PTR("cdata not defined", __func__, NULL);
#  151|       if (size < sizeof(BMP_FH) + sizeof(BMP_IH))
#  152|           return (PIX *)ERROR_PTR("bmf size error", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def7]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c: scope_hint: In function ‘boxaRemoveVGaps’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:315:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘delta’
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: COMPILER_WARNING (CWE-457): [#def8]
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c: scope_hint: In function ‘boxaRemoveVGaps.isra.0’
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:315:5: warning[-Wmaybe-uninitialized]: ‘delta’ may be used uninitialized
#  315 |     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.85.0-build/leptonica-1.85.0/src/partify.c:302:35: note: ‘delta’ was declared here
#  302 | l_int32  nbox, i, y1, h1, y2, h2, delta;
#      |                                   ^~~~~
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

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-118.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-nameleptonica-1.84.1-4.fc41
diffbase-store-results-to/tmp/tmpqqozi7hc/leptonica-1.84.1-4.fc41.tar.xz
diffbase-time-created2024-11-13 01:13:24
diffbase-time-finished2024-11-13 01:25:56
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpqqozi7hc/leptonica-1.84.1-4.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpqqozi7hc/leptonica-1.84.1-4.fc41.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-118.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameleptonica-1.85.0-1.fc42
store-results-to/tmp/tmpm2ws3w92/leptonica-1.85.0-1.fc42.tar.xz
time-created2024-11-13 01:26:26
time-finished2024-11-13 01:38:09
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpm2ws3w92/leptonica-1.85.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpm2ws3w92/leptonica-1.85.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9