Fixed defects

List of Defects

Error: CLANG_WARNING: [#def1]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1892:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1890|           }
# 1891|       }
# 1892|->     if ((code = param_read_string(plist, "DeviceLinkProfile", &icc_pro)) != 1) {
# 1893|           if ((code = gx_default_put_icc(&icc_pro, dev, gsLINKPROFILE)) < 0) {
# 1894|               ecode = code;

Error: CLANG_WARNING: [#def2]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1898:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1896|           }
# 1897|       }
# 1898|->     if ((code = param_read_string(plist, "PostRenderProfile", &icc_pro)) != 1) {
# 1899|           if ((code = gx_default_put_icc(&icc_pro, dev, gsPRPROFILE)) < 0) {
# 1900|               ecode = code;

Error: CLANG_WARNING: [#def3]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1904:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1902|           }
# 1903|       }
# 1904|->     if ((code = param_read_string(plist, "OutputICCProfile", &icc_pro)) != 1) {
# 1905|           if ((code = gx_default_put_icc(&icc_pro, dev, gsDEFAULTPROFILE)) < 0) {
# 1906|               ecode = code;

Error: CLANG_WARNING: [#def4]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1912:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1910|       /* Note, if a change is made to NUM_DEVICE_PROFILES we need to update
# 1911|          this with the name of the profile */
# 1912|->     if ((code = param_read_string(plist, "VectorICCProfile", &icc_pro)) != 1) {
# 1913|           if ((code = gx_default_put_icc(&icc_pro, dev, gsGRAPHICPROFILE)) < 0) {
# 1914|               ecode = code;

Error: CLANG_WARNING: [#def5]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1918:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1916|           }
# 1917|       }
# 1918|->     if ((code = param_read_string(plist, "ImageICCProfile", &icc_pro)) != 1) {
# 1919|           if ((code = gx_default_put_icc(&icc_pro, dev, gsIMAGEPROFILE)) < 0) {
# 1920|               ecode = code;

Error: CLANG_WARNING: [#def6]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1924:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1922|           }
# 1923|       }
# 1924|->     if ((code = param_read_string(plist, "TextICCProfile", &icc_pro)) != 1) {
# 1925|           if ((code = gx_default_put_icc(&icc_pro, dev, gsTEXTPROFILE)) < 0) {
# 1926|               ecode = code;

Error: CLANG_WARNING: [#def7]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1930:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1928|           }
# 1929|       }
# 1930|->     if ((code = param_read_string(plist, "ProofProfile", &icc_pro)) != 1) {
# 1931|           if ((code = gx_default_put_icc(&icc_pro, dev, gsPROOFPROFILE)) < 0) {
# 1932|               ecode = code;

Error: CLANG_WARNING: [#def8]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:1936:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 1934|           }
# 1935|       }
# 1936|->     if ((code = param_read_string(plist, "BlendColorProfile", &icc_pro)) != 1) {
# 1937|           if ((code = gx_default_put_icc(&icc_pro, dev, gsBLENDPROFILE)) < 0) {
# 1938|               ecode = code;

Error: CLANG_WARNING: [#def9]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsdparam.c:2138:17: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code'
# 2136|       IGNORE_INT_PARAM("%MediaSource")
# 2137|           IGNORE_INT_PARAM("%MediaDestination")
# 2138|->         switch (code = param_read_float_array(plist, (param_name = "ImagingBBox"), &ibba)) {
# 2139|           case 0:
# 2140|               if (ibba.size != 4 ||

Error: COMPILER_WARNING (CWE-563): [#def10]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gx.h:23: included_from: Included from here.
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gdevprn.h:24: included_from: Included from here.
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/lips4/gdevlprn.h:32: included_from: Included from here.
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/lips4/gdevlprn.c:43: included_from: Included from here.
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/lips4/gdevlprn.c: scope_hint: In function ‘lprn_print_image’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gserrors.h:140:41: warning[-Wunused-value]: statement with no effect
#  140 | #  define gs_log_error(err, file, line) (err)
#      |                                         ^
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gserrors.h:142:28: note: in expansion of macro ‘gs_log_error’
#  142 | #define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__)
#      |                            ^~~~~~~~~~~~
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/lips4/gdevlprn.c:226:9: note: in expansion of macro ‘gs_note_error’
#  226 |         gs_note_error(gs_error_VMerror);
#      |         ^~~~~~~~~~~~~
#  138|   int gs_log_error(int, const char *, int);
#  139|   #if !defined(DEBUG)
#  140|-> #  define gs_log_error(err, file, line) (err)
#  141|   #endif
#  142|   #define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__)

Error: GCC_ANALYZER_WARNING (CWE-121): [#def11]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c: scope_hint: In function ‘line_join_points’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:302:12: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gsptype2.h:26: included_from: Included from here.
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:25: included_from: Included from here.
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2297:12: note: in expansion of macro ‘gx_path_close_subpath’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2334:13: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2493:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:302:12: note: write of 4 bytes to beyond the end of ‘points’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:302:12: note: valid subscripts for ‘points’ are ‘[0]’ to ‘[4]’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
#  300|   /* if we simply implemented it as an assignment. */
#  301|   #define ASSIGN_POINT(pp, p)\
#  302|->   ((pp)->x = (p).x, (pp)->y = (p).y)
#  303|   
#  304|   /* Other forward declarations */

Error: GCC_ANALYZER_WARNING (CWE-121): [#def12]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:302:29: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2297:12: note: in expansion of macro ‘gx_path_close_subpath’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2334:13: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2493:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:302:29: note: write of 4 bytes to beyond the end of ‘points’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:302:29: note: valid subscripts for ‘points’ are ‘[0]’ to ‘[4]’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/gxstroke.c:2504:9: note: in expansion of macro ‘ASSIGN_POINT’
#  300|   /* if we simply implemented it as an assignment. */
#  301|   #define ASSIGN_POINT(pp, p)\
#  302|->   ((pp)->x = (p).x, (pp)->y = (p).y)
#  303|   
#  304|   /* Other forward declarations */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def13]
ghostscript-10.02.1-build/ghostscript-10.02.1/base/stream.c: scope_hint: In function ‘stream_compact’
ghostscript-10.02.1-build/ghostscript-10.02.1/base/stream.c:1014:9: warning[-Wanalyzer-null-argument]: use of NULL ‘*s.cbuf’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null
# 1012|           uint dist = s->cursor.r.ptr + 1 - s->cbuf;
# 1013|   
# 1014|->         memmove(s->cbuf, s->cursor.r.ptr + 1,
# 1015|                   (uint) (s->cursor.r.limit - s->cursor.r.ptr));
# 1016|           s->cursor.r.ptr = s->cbuf - 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def14]
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/opvp/gdevopvp.c: scope_hint: In function ‘SetBgColorWrapper’
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/opvp/gdevopvp.c:768:14: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*brush.colorSpace’
#  766|           return -1;
#  767|       }
#  768|->     if (brush->colorSpace == OPVP_CSPACE_DEVICEKRGB) {
#  769|           /* 0.2 doesn't have OPVP_CSPACE_DEVICEKRGB */
#  770|           *(opdev->globals.ErrorNo) = OPVP_NOTSUPPORTED_0_2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
ghostscript-10.02.1-build/ghostscript-10.02.1/contrib/opvp/gdevopvp.c:3648:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
# 3646|       if (buff) free(buff);
# 3647|   
# 3648|->     return ecode;
# 3649|   }
# 3650|   

Error: CLANG_WARNING: [#def16]
ghostscript-10.02.1-build/ghostscript-10.02.1/devices/gdevpsd.c:572:5: warning[deadcode.DeadStores]: Value stored to 'code' is never read
#  570|       pdev->log2_align_mod = 6;
#  571|   #endif
#  572|->     code = dev_proc(pdev, get_profile)((gx_device *)pdev, &profile_struct);
#  573|   
#  574|       pdev_psd->warning_given = false;

Error: COMPILER_WARNING (CWE-563): [#def17]
ghostscript-10.02.1-build/ghostscript-10.02.1/pdf/ghostpdf.c:1179:16: warning[-Wunused-variable]: unused variable ‘Permissions’
# 1179 |         double Permissions = 0;
#      |                ^~~~~~~~~~~
# 1177|           /* See comment in pdfi_read_Root() (pdf_doc.c) for details */
# 1178|           pdf_dict *d = ctx->Trailer;
# 1179|->         double Permissions = 0;
# 1180|           uint32_t P = 0;
# 1181|   

Error: COMPILER_WARNING (CWE-563): [#def18]
ghostscript-10.02.1-build/ghostscript-10.02.1/pdf/ghostpdf.c:1180:18: warning[-Wunused-variable]: unused variable ‘P’
# 1180 |         uint32_t P = 0;
#      |                  ^
# 1178|           pdf_dict *d = ctx->Trailer;
# 1179|           double Permissions = 0;
# 1180|->         uint32_t P = 0;
# 1181|   
# 1182|           pdfi_countup(d);

Error: COMPILER_WARNING: [#def19]
ghostscript-10.02.1-build/ghostscript-10.02.1/pdf/ghostpdf.c: scope_hint: In function ‘pdfi_init_file’
ghostscript-10.02.1-build/ghostscript-10.02.1/pdf/ghostpdf.c:1199:5: warning[-Wundef]: "USE_PDF_PERMISSIONS" is not defined, evaluates to 0
# 1199 | #if USE_PDF_PERMISSIONS
#      |     ^~~~~~~~~~~~~~~~~~~
# 1197|                    * device, then we will throw an error..
# 1198|                    */
# 1199|-> #if USE_PDF_PERMISSIONS
# 1200|                   code = pdfi_dict_knownget_number(ctx, (pdf_dict *)o, "P", &Permissions);
# 1201|                   if (code < 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def20]
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/zbfont.c:981:5: warning[-Wanalyzer-null-argument]: use of NULL ‘kname.value.bytes’ where non-null expected
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/store.h:236:3: note: in expansion of macro ‘make_tasv’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/store.h:240:3: note: in expansion of macro ‘make_string’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/zbfont.c:969:13: note: in expansion of macro ‘make_empty_string’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/iref.h:499:31: note: in expansion of macro ‘r_type’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/zbfont.c:742:10: note: in expansion of macro ‘r_has_type’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/zbfont.c:836:17: note: in expansion of macro ‘r_ptr’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/ialloc.h:30:33: note: in expansion of macro ‘iimemory’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/zbfont.c:853:40: note: in expansion of macro ‘imemory’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/store.h:236:3: note: in expansion of macro ‘make_tasv’
ghostscript-10.02.1-build/ghostscript-10.02.1/psi/store.h:240:3: note: in expansion of macro ‘make_string’
ghostscript-10.02.1-build/ghostscript-10.02.1/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;

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-184.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-nameghostscript-10.03.1-2.fc41
diffbase-store-results-to/tmp/tmpvn05j0pi/ghostscript-10.03.1-2.fc41.tar.xz
diffbase-time-created2024-07-03 12:59:35
diffbase-time-finished2024-07-03 13:12:46
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpvn05j0pi/ghostscript-10.03.1-2.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpvn05j0pi/ghostscript-10.03.1-2.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-184.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameghostscript-10.02.1-8.fc40
store-results-to/tmp/tmpmjhsfgrs/ghostscript-10.02.1-8.fc40.tar.xz
time-created2024-07-03 12:45:33
time-finished2024-07-03 12:59:07
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpmjhsfgrs/ghostscript-10.02.1-8.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpmjhsfgrs/ghostscript-10.02.1-8.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9