Newly introduced findings

List of Findings

Error: CPPCHECK_WARNING (CWE-457): [#def1]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gdevp14.c:7395: warning[uninitvar]: Uninitialized variable: comp_bits
# 7393|       memset(&(pdev->color_info.comp_bits), 0, GX_DEVICE_COLOR_MAX_COMPONENTS);
# 7394|       memset(&(pdev->color_info.comp_shift), 0, GX_DEVICE_COLOR_MAX_COMPONENTS);
# 7395|->     memcpy(&(pdev->color_info.comp_bits), comp_bits, new_num_comps);
# 7396|       memcpy(&(pdev->color_info.comp_shift), comp_shift, new_num_comps);
# 7397|       group_color->max_color = pdev->color_info.max_color = deep ? 65535 : 255;

Error: CPPCHECK_WARNING (CWE-457): [#def2]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gdevp14.c:7396: warning[uninitvar]: Uninitialized variable: comp_shift
# 7394|       memset(&(pdev->color_info.comp_shift), 0, GX_DEVICE_COLOR_MAX_COMPONENTS);
# 7395|       memcpy(&(pdev->color_info.comp_bits), comp_bits, new_num_comps);
# 7396|->     memcpy(&(pdev->color_info.comp_shift), comp_shift, new_num_comps);
# 7397|       group_color->max_color = pdev->color_info.max_color = deep ? 65535 : 255;
# 7398|       group_color->max_gray = pdev->color_info.max_gray = deep ? 65535 : 255;

Error: COMPILER_WARNING (CWE-758): [#def3]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gscspace.c:679:1: warning[-Wmissing-prototypes]: no previous prototype for ‘check_rgb_color_model_comps’
#  679 | check_rgb_color_model_comps(gx_device * dev)
#      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  677|   
#  678|   void
#  679|-> check_rgb_color_model_comps(gx_device * dev)
#  680|   {
#  681|       gx_device_color_info *          pcinfo = &dev->color_info;

Error: CPPCHECK_WARNING (CWE-758): [#def4]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gsdevice.c:1102: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1100|                               if (strchr("0123456789", pfn->fname[i])) {
# 1101|                                   width[field] = width[field] * 10 + pfn->fname[i] - '0';
# 1102|->                                 if (width[field] > max_int)
# 1103|   	                                return_error(gs_error_undefinedfilename);
# 1104|                                   continue;

Error: CPPCHECK_WARNING (CWE-758): [#def5]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gsdevice.c:1132: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1130|           w = max(width[0], width[1]);
# 1131|           w = max(w, int_width) + 5;
# 1132|->         if (w > max_int)
# 1133|               return_error(gs_error_undefinedfilename);
# 1134|       }

Error: CPPCHECK_WARNING (CWE-758): [#def6]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclip.c:1442: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1440|                   /* Clamp the values so they won't overflow when converting to fixed. */
# 1441|   #define SAFE_CONVERT2FIXED(x)  if (x < fixed2int(min_int)) x = fixed2int(min_int); else if (x > fixed2int(max_int)) x = fixed2int(max_int); else x = int2fixed(x);
# 1442|->                 SAFE_CONVERT2FIXED(cbox.p.x);
# 1443|                   SAFE_CONVERT2FIXED(cbox.p.y);
# 1444|                   SAFE_CONVERT2FIXED(cbox.q.x);

Error: CPPCHECK_WARNING (CWE-758): [#def7]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclip.c:1443: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1441|   #define SAFE_CONVERT2FIXED(x)  if (x < fixed2int(min_int)) x = fixed2int(min_int); else if (x > fixed2int(max_int)) x = fixed2int(max_int); else x = int2fixed(x);
# 1442|                   SAFE_CONVERT2FIXED(cbox.p.x);
# 1443|->                 SAFE_CONVERT2FIXED(cbox.p.y);
# 1444|                   SAFE_CONVERT2FIXED(cbox.q.x);
# 1445|                   SAFE_CONVERT2FIXED(cbox.q.y);

Error: CPPCHECK_WARNING (CWE-758): [#def8]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclip.c:1444: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1442|                   SAFE_CONVERT2FIXED(cbox.p.x);
# 1443|                   SAFE_CONVERT2FIXED(cbox.p.y);
# 1444|->                 SAFE_CONVERT2FIXED(cbox.q.x);
# 1445|                   SAFE_CONVERT2FIXED(cbox.q.y);
# 1446|   #undef SAFE_CONVERT2FIXED

Error: CPPCHECK_WARNING (CWE-758): [#def9]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclip.c:1445: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1443|                   SAFE_CONVERT2FIXED(cbox.p.y);
# 1444|                   SAFE_CONVERT2FIXED(cbox.q.x);
# 1445|->                 SAFE_CONVERT2FIXED(cbox.q.y);
# 1446|   #undef SAFE_CONVERT2FIXED
# 1447|               }

Error: CPPCHECK_WARNING (CWE-758): [#def10]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclip.c:1523: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1521|            * (max_int, max_int). Hence it doesn't 'stop' cases when y == max_int.
# 1522|            * These shouldn't really happen, but let's be sure. */
# 1523|->         if (y == max_int)
# 1524|               return 0;
# 1525|           if ((rptr = rptr->next) != NULL)

Error: CPPCHECK_WARNING (CWE-457): [#def11]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclthrd.c:904: warning[uninitvar]: Uninitialized variable: code
#  902|           (endtime[1] - starttime[1]) / 1000000;
#  903|   #endif
#  904|->     if (code < 0)
#  905|           thread->status = THREAD_ERROR;          /* shouldn't happen */
#  906|       else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def12]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclthrd.c: scope_hint: In function ‘clist_render_thread_no_output_fn’
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxclthrd.c:904:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘code’
#  902|           (endtime[1] - starttime[1]) / 1000000;
#  903|   #endif
#  904|->     if (code < 0)
#  905|           thread->status = THREAD_ERROR;          /* shouldn't happen */
#  906|       else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def13]
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxcmap.c: scope_hint: In function ‘cmap_separation_direct’
ghostscript-10.04.0-build/ghostscript-10.04.0/base/gxcmap.c:1516:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cv[j]’
# 1514|           int j;
# 1515|           for (j = 0; j < num_additives; j++)
# 1516|->             cv[j] = 65535 - cv[j];
# 1517|       }
# 1518|       /* Copy tags untransformed. */

Error: COMPILER_WARNING (CWE-563): [#def14]
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevpppm.c:141:9: warning[-Wunused-variable]: unused variable ‘x’
#  141 |     int x, y;
#      |         ^
#  139|       int raster = bitmap_raster(bdev->width * 3 * 8);
#  140|       int h = rect->q.y - rect->p.y;
#  141|->     int x, y;
#  142|       unsigned char *p;
#  143|       gs_int_rect my_rect;

Error: COMPILER_WARNING (CWE-563): [#def15]
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevpppm.c:144:9: warning[-Wunused-variable]: unused variable ‘err’
#  144 |     int err;
#      |         ^~~
#  142|       unsigned char *p;
#  143|       gs_int_rect my_rect;
#  144|->     int err;
#  145|       int page_height = gx_downscaler_scale_rounded(dev->height, fdev->downscale.downscale_factor);
#  146|       gs_offset_t offset = fdev->header_len;

Error: COMPILER_WARNING (CWE-563): [#def16]
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevpppm.c: scope_hint: In function ‘pppm_process_and_output’
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevpppm.c:145:9: warning[-Wunused-variable]: unused variable ‘page_height’
#  145 |     int page_height = gx_downscaler_scale_rounded(dev->height, fdev->downscale.downscale_factor);
#      |         ^~~~~~~~~~~
#  143|       gs_int_rect my_rect;
#  144|       int err;
#  145|->     int page_height = gx_downscaler_scale_rounded(dev->height, fdev->downscale.downscale_factor);
#  146|       gs_offset_t offset = fdev->header_len;
#  147|       gx_device_clist_reader *clrdev = (gx_device_clist_reader *)dev;

Error: COMPILER_WARNING (CWE-563): [#def17]
ghostscript-10.04.0-build/ghostscript-10.04.0/pdf/pdf_annot.c: scope_hint: In function ‘pdfi_annot_draw_Popup’
ghostscript-10.04.0-build/ghostscript-10.04.0/pdf/pdf_annot.c:2863:10: warning[-Wunused-variable]: unused variable ‘known’
# 2863 |     bool known = false;
#      |          ^~~~~
# 2861|       gs_rect rect, rect2;
# 2862|       bool need_grestore = false;
# 2863|->     bool known = false;
# 2864|   
# 2865|       /* Render only if open */

Error: CPPCHECK_WARNING (CWE-758): [#def18]
ghostscript-10.04.0-build/ghostscript-10.04.0/pdf/pdf_int.c:235: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  233|       int code = 0, malformed = false, doubleneg = false, recovered = false, negative = false, overflowed = false;
#  234|       unsigned int int_val = 0;
#  235|->     int tenth_max_int = max_int / 10, tenth_max_uint = max_uint / 10;
#  236|   
#  237|       pdfi_skip_white(ctx, s);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def19]
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:981:5: warning[-Wanalyzer-null-argument]: use of NULL ‘kname.value.bytes’ where non-null expected
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/ivmspace.h:43:33: note: in expansion of macro ‘r_type_attrs’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:567:32: note: in expansion of macro ‘r_space’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/store.h:236:3: note: in expansion of macro ‘make_tasv’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/store.h:240:3: note: in expansion of macro ‘make_string’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:969:13: note: in expansion of macro ‘make_empty_string’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/iref.h:499:31: note: in expansion of macro ‘r_type’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:742:10: note: in expansion of macro ‘r_has_type’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:836:17: note: in expansion of macro ‘r_ptr’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/ialloc.h:30:33: note: in expansion of macro ‘iimemory’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:853:40: note: in expansion of macro ‘imemory’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/store.h:236:3: note: in expansion of macro ‘make_tasv’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/store.h:240:3: note: in expansion of macro ‘make_string’
ghostscript-10.04.0-build/ghostscript-10.04.0/psi/zbfont.c:713:9: note: in expansion of macro ‘make_empty_string’
<built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null
#  979|       if (size > gs_font_name_max)
#  980|           size = gs_font_name_max;
#  981|->     memcpy(&pfstr->chars[0], pfname->value.const_bytes, size);
#  982|       /* Following is only for debugging printout. */
#  983|       pfstr->chars[size] = 0;

Error: COMPILER_WARNING (CWE-704): [#def20]
ghostscript-10.04.0-build/ghostscript-10.04.0/soobj/gconfig.h:112:1: warning[-Wlto-type-mismatch]: type of ‘gs_pppm_device’ does not match original declaration
#  112 | device2_(gs_pppm_device)
#      | ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevpppm.c:121:22: note: type ‘const struct gx_device_pppm’ should match type ‘const struct gx_device’
#  121 | const gx_device_pppm gs_pppm_device =
#      |                      ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevpppm.c:121:22: note: ‘gs_pppm_device’ was previously declared here
#  110|   device2_(gs_ppm_device)
#  111|   device2_(gs_ppmraw_device)
#  112|-> device2_(gs_pppm_device)
#  113|   device2_(gs_ps2write_device)
#  114|   device2_(gs_pdfwrite_device)

Error: COMPILER_WARNING (CWE-704): [#def21]
ghostscript-10.04.0-build/ghostscript-10.04.0/soobj/gconfig.h:148:1: warning[-Wlto-type-mismatch]: type of ‘gs_urfcmyk_device’ does not match original declaration
#  148 | device2_(gs_urfcmyk_device)
#      | ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevurf.c:287:21: note: type ‘const struct gx_device_urf’ should match type ‘const struct gx_device’
#  287 | const gx_device_urf gs_urfcmyk_device =
#      |                     ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevurf.c:287:21: note: ‘gs_urfcmyk_device’ was previously declared here
#  146|   device2_(gs_tiffsep1_device)
#  147|   device2_(gs_txtwrite_device)
#  148|-> device2_(gs_urfcmyk_device)
#  149|   device2_(gs_urfgray_device)
#  150|   device2_(gs_urfrgb_device)

Error: COMPILER_WARNING (CWE-704): [#def22]
ghostscript-10.04.0-build/ghostscript-10.04.0/soobj/gconfig.h:149:1: warning[-Wlto-type-mismatch]: type of ‘gs_urfgray_device’ does not match original declaration
#  149 | device2_(gs_urfgray_device)
#      | ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevurf.c:269:21: note: type ‘const struct gx_device_urf’ should match type ‘const struct gx_device’
#  269 | const gx_device_urf gs_urfgray_device =
#      |                     ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevurf.c:269:21: note: ‘gs_urfgray_device’ was previously declared here
#  147|   device2_(gs_txtwrite_device)
#  148|   device2_(gs_urfcmyk_device)
#  149|-> device2_(gs_urfgray_device)
#  150|   device2_(gs_urfrgb_device)
#  151|   #endif

Error: COMPILER_WARNING (CWE-704): [#def23]
ghostscript-10.04.0-build/ghostscript-10.04.0/soobj/gconfig.h:150:1: warning[-Wlto-type-mismatch]: type of ‘gs_urfrgb_device’ does not match original declaration
#  150 | device2_(gs_urfrgb_device)
#      | ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevurf.c:278:21: note: type ‘const struct gx_device_urf’ should match type ‘const struct gx_device’
#  278 | const gx_device_urf gs_urfrgb_device =
#      |                     ^
ghostscript-10.04.0-build/ghostscript-10.04.0/devices/gdevurf.c:278:21: note: ‘gs_urfrgb_device’ was previously declared here
#  148|   device2_(gs_urfcmyk_device)
#  149|   device2_(gs_urfgray_device)
#  150|-> device2_(gs_urfrgb_device)
#  151|   #endif
#  152|   #ifdef device_

Error: CPPCHECK_WARNING (CWE-758): [#def24]
ghostscript-10.04.0-build/ghostscript-10.04.0/urf/urffilter.c:13: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   11|   
#   12|           check_dict_read(*dop);
#   13|->         if ((code = dict_int_param(dop, "Width", 1, max_int, URF_default_width, width)) < 0)
#   14|               return code;
#   15|           if ((code = dict_int_param(dop, "BPP", 8, 32, URF_default_bpp, bpp)) < 0)

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-148.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-nameghostscript-10.03.1-3.fc41
diffbase-store-results-to/tmp/tmpftp498j2/ghostscript-10.03.1-3.fc41.tar.xz
diffbase-time-created2024-11-12 23:53:13
diffbase-time-finished2024-11-13 00:03:05
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpftp498j2/ghostscript-10.03.1-3.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpftp498j2/ghostscript-10.03.1-3.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-148.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameghostscript-10.04.0-1.fc42
store-results-to/tmp/tmpuxbxhhnk/ghostscript-10.04.0-1.fc42.tar.xz
time-created2024-11-13 00:03:29
time-finished2024-11-13 00:13:02
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpuxbxhhnk/ghostscript-10.04.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpuxbxhhnk/ghostscript-10.04.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9