Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-563): [#def1]
ghostscript-10.05.1/base/gdevdbit.c: scope_hint: In function ‘gx_default_strip_tile_rect_devn’
ghostscript-10.05.1/base/gdevdbit.c:603:11: warning[-Wunused-variable]: unused variable ‘tile_id’
#  603 |     gs_id tile_id = tiles->id;
#      |           ^~~~~~~
#  601|       int rheight = tiles->rep_height;
#  602|       int shift = tiles->shift;
#  603|->     gs_id tile_id = tiles->id;
#  604|       int code;
#  605|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
ghostscript-10.05.1/base/gsicc_manage.c:1691:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘gsicc_new_namelist(mem)’
ghostscript-10.05.1/base/gsicc_manage.c:1585:1: enter_function: entry to ‘gsicc_set_device_profile_colorants’
ghostscript-10.05.1/base/gsicc_manage.c:1601:8: branch_true: following ‘true’ branch...
ghostscript-10.05.1/base/gsicc_manage.c:1602:12: branch_true: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1651:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/base/gsicc_manage.c:1659:22: branch_false: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1659:22: call_function: calling ‘gsicc_new_namelist’ from ‘gsicc_set_device_profile_colorants’
ghostscript-10.05.1/base/gsicc_manage.c:1659:22: return_function: returning to ‘gsicc_set_device_profile_colorants’ from ‘gsicc_new_namelist’
ghostscript-10.05.1/base/gsicc_manage.c:1663:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/base/gsicc_manage.c:1665:9: branch_false: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1671:16: branch_true: following ‘true’ branch (when ‘pch’ is non-NULL)...
ghostscript-10.05.1/base/gsicc_manage.c:1672:17: branch_true: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1672:16: branch_false: following ‘false’ branch...
ghostscript-10.05.1/base/gsicc_manage.c:1672:16: branch_false: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1679:20: branch_false: following ‘false’ branch...
ghostscript-10.05.1/base/gsicc_manage.c:1686:26: branch_false: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1686:26: call_function: calling ‘gsicc_new_colorname’ from ‘gsicc_set_device_profile_colorants’
ghostscript-10.05.1/base/gsicc_manage.c:1686:26: return_function: returning to ‘gsicc_set_device_profile_colorants’ from ‘gsicc_new_colorname’
ghostscript-10.05.1/base/gsicc_manage.c:1687:16: branch_false: following ‘false’ branch...
ghostscript-10.05.1/base/gsicc_manage.c:1690:13: branch_false: ...to here
ghostscript-10.05.1/base/gsicc_manage.c:1691:13: danger: dereference of NULL ‘gsicc_new_namelist(mem)’
# 1689|               /* Set our current entry to this one */
# 1690|               *curr_entry = name_entry;
# 1691|->             spot_names->count += 1;
# 1692|               name_entry->length = strlen(temp_ptr);
# 1693|               name_entry->name = (char *) gs_alloc_bytes(mem, name_entry->length,

Error: COMPILER_WARNING (CWE-457): [#def3]
ghostscript-10.05.1/base/gx.h:26: included_from: Included from here.
ghostscript-10.05.1/base/gdevprn.h:24: included_from: Included from here.
ghostscript-10.05.1/contrib/japanese/gdev10v.c:33: included_from: Included from here.
ghostscript-10.05.1/contrib/japanese/gdev10v.c: scope_hint: In function ‘bj10v_print_page’
ghostscript-10.05.1/base/gsmalloc.h:58:21: warning[-Wmaybe-uninitialized]: ‘in’ may be used uninitialized
#   58 |   gs_free_object(mem->non_gc_memory, data, cname)
ghostscript-10.05.1/contrib/japanese/gdev10v.c:202:15: note: ‘in’ was declared here
#  202 |         byte *in, *out;
#      |               ^~
#   56|     (void *)gs_alloc_byte_array(mem->non_gc_memory, nelts, esize, cname)
#   57|   #define gs_free(mem, data, nelts, esize, cname)\
#   58|->   gs_free_object(mem->non_gc_memory, data, cname)
#   59|   
#   60|   /* ---------------- Locking ---------------- */

Error: COMPILER_WARNING (CWE-457): [#def4]
ghostscript-10.05.1/base/gsmalloc.h:58:21: warning[-Wmaybe-uninitialized]: ‘out’ may be used uninitialized
#   58 |   gs_free_object(mem->non_gc_memory, data, cname)
ghostscript-10.05.1/contrib/japanese/gdev10v.c:202:20: note: ‘out’ was declared here
#  202 |         byte *in, *out;
#      |                    ^~~
#   56|     (void *)gs_alloc_byte_array(mem->non_gc_memory, nelts, esize, cname)
#   57|   #define gs_free(mem, data, nelts, esize, cname)\
#   58|->   gs_free_object(mem->non_gc_memory, data, cname)
#   59|   
#   60|   /* ---------------- Locking ---------------- */

Error: CPPCHECK_WARNING (CWE-190): [#def5]
ghostscript-10.05.1/base/gxccman.c:82: error[integerOverflow]: Signed integer overflow for expression '-((((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8))&((((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8))-1)?(((int)sizeof(struct cached_char))+((((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8))-1))/(((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8))*(((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8)):(((int)sizeof(struct cached_char))+((((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8))-1))&-(((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8)))'.
#   80|          cache character memory before filling the table.  The searching
#   81|          code uses an empty table entry as a sentinel. */
#   82|->     chsize = max(chsize, ROUND_UP(bmax, sizeof_cached_char) / sizeof_cached_char + 1);
#   83|   
#   84|       /* Round up chsize to a power of 2. */

Error: CPPCHECK_WARNING (CWE-190): [#def6]
ghostscript-10.05.1/base/gxccman.c:762: error[integerOverflow]: Signed integer overflow for expression '-(((1<<3)>((8>8)?(8):8))?(1<<3):((8>8)?(8):8))'.
#  760|       cc_set_raster(cc, nraster);
#  761|       {
#  762|->         uint diff = ROUND_DOWN(cc->head.size - sizeof_cached_char -
#  763|                                  nraster * cc->height,
#  764|                                  align_cached_char_mod);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def7]
ghostscript-10.05.1/contrib/gdevadmp.c:212:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
ghostscript-10.05.1/contrib/gdevadmp.c:165:1: enter_function: entry to ‘dmp_print_page’
ghostscript-10.05.1/contrib/gdevadmp.c:175:28: call_function: inlined call to ‘gp_get_file’ from ‘dmp_print_page’
ghostscript-10.05.1/contrib/gdevadmp.c:178:30: branch_true: ...to here
ghostscript-10.05.1/contrib/gdevadmp.c:187:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/gdevadmp.c:212:9: danger: argument 2 (‘<unknown>’) NULL where non-null expected
#  210|           /* Initialize the printer and reset the margins. */
#  211|   
#  212|->         fputs("\r\n\033>\033T16", prn_stream);
#  213|   
#  214|           switch(dev_type)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
ghostscript-10.05.1/contrib/japanese/gdev10v.c:335:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘out’
ghostscript-10.05.1/contrib/japanese/gdev10v.c:335:9: branch_true: following ‘true’ branch...
ghostscript-10.05.1/contrib/japanese/gdev10v.c:335:9: branch_true: ...to here
ghostscript-10.05.1/contrib/japanese/gdev10v.c:335:9: danger: use of uninitialized value ‘out’ here
#  333|           prn_flush(pdev);
#  334|   error:
#  335|->         gs_free(pdev->memory->non_gc_memory, (char *)out, bits_per_column, line_size, "bj10v_print_page(out)");
#  336|           gs_free(pdev->memory->non_gc_memory, (char *)in, 8, line_size, "bj10v_print_page(in)");
#  337|           return code;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def9]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:1569:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4688:1: enter_function: entry to ‘opvp_beginpage’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4698:12: call_function: calling ‘opvp_startpage’ from ‘opvp_beginpage’
# 1567|       if (string) {
# 1568|           *destin = realloc(*destin, strlen(*destin) +strlen(string)+1);
# 1569|->         strcat(*destin, string);
# 1570|       }
# 1571|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:1657:24: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open("UTF-8", locale)’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4688:1: enter_function: entry to ‘opvp_beginpage’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4698:12: call_function: calling ‘opvp_startpage’ from ‘opvp_beginpage’
# 1655|               if (locale) {
# 1656|                   if (strcmp(locale, "C") && buff) {
# 1657|->                     if ((cd = iconv_open("UTF-8", locale)) != (iconv_t)-1) {
# 1658|                           ibuff = string;
# 1659|                           obuff = buff;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:1657:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4688:1: enter_function: entry to ‘opvp_beginpage’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4698:12: call_function: calling ‘opvp_startpage’ from ‘opvp_beginpage’
# 1655|               if (locale) {
# 1656|                   if (strcmp(locale, "C") && buff) {
# 1657|->                     if ((cd = iconv_open("UTF-8", locale)) != (iconv_t)-1) {
# 1658|                           ibuff = string;
# 1659|                           obuff = buff;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:1660:29: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open("UTF-8", locale)’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4688:1: enter_function: entry to ‘opvp_beginpage’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4698:12: call_function: calling ‘opvp_startpage’ from ‘opvp_beginpage’
# 1658|                           ibuff = string;
# 1659|                           obuff = buff;
# 1660|->                         if (iconv(cd, &ibuff, &ib, &obuff, &ob) != -1) {
# 1661|                               *obuff = 0;
# 1662|                               complete = true;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:1660:29: warning[-Wanalyzer-malloc-leak]: leak of ‘obuff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4688:1: enter_function: entry to ‘opvp_beginpage’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:4698:12: call_function: calling ‘opvp_startpage’ from ‘opvp_beginpage’
# 1658|                           ibuff = string;
# 1659|                           obuff = buff;
# 1660|->                         if (iconv(cd, &ibuff, &ib, &obuff, &ob) != -1) {
# 1661|                               *obuff = 0;
# 1662|                               complete = true;

Error: CPPCHECK_WARNING (CWE-401): [#def14]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:2399: error[memleakOnRealloc]: Common realloc mistake: 'p' nulled but not freed upon failure
# 2397|                == OPVP_PARAMERROR && nn > n) {
# 2398|               /* realloc buffer and retry */
# 2399|->             p = realloc(p,nn*sizeof(opvp_cspace_t));
# 2400|               r = gsopvpQueryColorSpace(dev, pdev->globals.printerContext,&nn,p);
# 2401|           }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3466:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
# 3464|           }
# 3465|           buff = realloc(buff, vdps.size + 1);
# 3466|->         memcpy(buff, vdps.data, vdps.size);
# 3467|           buff[vdps.size] = 0;
# 3468|           opvp_alloc_string(&(opdev->globals.vectorDriver), buff);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3480:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3480:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3480:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/3)
# 3478|       /* printer model name */
# 3479|       pname = "Model";
# 3480|->     code = param_read_string(plist, pname, &pmps);
# 3481|       switch (code) {
# 3482|       case 0:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3493:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3493:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3493:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/3)
# 3491|       default:
# 3492|           ecode = code;
# 3493|->         param_signal_error(plist, pname, ecode);
# 3494|       }
# 3495|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3498:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3498:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3498:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/3)
# 3496|       /* job info */
# 3497|       pname = "JobInfo";
# 3498|->     code = param_read_string(plist, pname, &jips);
# 3499|       switch (code) {
# 3500|       case 0:

Error: GCC_ANALYZER_WARNING (CWE-415): [#def19]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3501:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3486:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3486:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3501:16: danger: second ‘free’ here
# 3499|       switch (code) {
# 3500|       case 0:
# 3501|->         buff = realloc(buff, jips.size + 1);
# 3502|           memcpy(buff, jips.data, jips.size);
# 3503|           buff[jips.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def20]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3502:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3486:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3486:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3502:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3500|       case 0:
# 3501|           buff = realloc(buff, jips.size + 1);
# 3502|->         memcpy(buff, jips.data, jips.size);
# 3503|           buff[jips.size] = 0;
# 3504|           opvp_alloc_string(&(opdev->globals.jobInfo), buff);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3511:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3511:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3511:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/3)
# 3509|       default:
# 3510|           ecode = code;
# 3511|->         param_signal_error(plist, pname, ecode);
# 3512|       }
# 3513|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3516:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3516:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3516:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/3)
# 3514|       /* doc info */
# 3515|       pname = "DocInfo";
# 3516|->     code = param_read_string(plist, pname, &dips);
# 3517|       switch (code) {
# 3518|       case 0:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3529:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3529:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3529:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/3)
# 3527|       default:
# 3528|           ecode = code;
# 3529|->         param_signal_error(plist, pname, ecode);
# 3530|       }
# 3531|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3534:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3534:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3534:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/3)
# 3532|       /* fast image support */
# 3533|       pname = "FastImage";
# 3534|->     code = param_read_string(plist, pname, &fips);
# 3535|       switch (code) {
# 3536|       case 0:

Error: CPPCHECK_WARNING (CWE-401): [#def25]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3537: error[memleakOnRealloc]: Common realloc mistake: 'buff' nulled but not freed upon failure
# 3535|       switch (code) {
# 3536|       case 0:
# 3537|->         buff = realloc(buff, fips.size + 1);
# 3538|           memcpy(buff, fips.data, fips.size);
# 3539|           buff[fips.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def26]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3537:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3537:16: danger: second ‘free’ here
# 3535|       switch (code) {
# 3536|       case 0:
# 3537|->         buff = realloc(buff, fips.size + 1);
# 3538|           memcpy(buff, fips.data, fips.size);
# 3539|           buff[fips.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3538:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3538:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3536|       case 0:
# 3537|           buff = realloc(buff, fips.size + 1);
# 3538|->         memcpy(buff, fips.data, fips.size);
# 3539|           buff[fips.size] = 0;
# 3540|           opvp_alloc_string(&fastImage, buff);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def28]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3537:16: release_memory: state of ‘(void *)0B’: ‘stop’ -> ‘freed’ (NULL origin)
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3540:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3540:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: release_memory: using NULL here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: danger: argument 1 (‘fastImage’) NULL where non-null expected
# 3539|           buff[fips.size] = 0;
# 3540|           opvp_alloc_string(&fastImage, buff);
# 3541|->         if (strcasecmp(fastImage,"NoCTM")==0) {
# 3542|               FastImageMode = FastImageNoCTM;
# 3543|           } else if (strncasecmp(fastImage,"NoRotate",8)==0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def29]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3540:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3540:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: release_memory: ‘buff’ is NULL
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: danger: argument 1 (‘fastImage’) NULL where non-null expected
# 3539|           buff[fips.size] = 0;
# 3540|           opvp_alloc_string(&fastImage, buff);
# 3541|->         if (strcasecmp(fastImage,"NoCTM")==0) {
# 3542|               FastImageMode = FastImageNoCTM;
# 3543|           } else if (strncasecmp(fastImage,"NoRotate",8)==0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def30]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: warning[-Wanalyzer-null-argument]: use of NULL ‘fastImage’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3540:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3540:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3541:13: danger: argument 1 (‘fastImage’) NULL where non-null expected
# 3539|           buff[fips.size] = 0;
# 3540|           opvp_alloc_string(&fastImage, buff);
# 3541|->         if (strcasecmp(fastImage,"NoCTM")==0) {
# 3542|               FastImageMode = FastImageNoCTM;
# 3543|           } else if (strncasecmp(fastImage,"NoRotate",8)==0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3560:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3560:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3560:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/3)
# 3558|       default:
# 3559|           ecode = code;
# 3560|->         param_signal_error(plist, pname, ecode);
# 3561|       }
# 3562|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3565:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3565:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3565:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/3)
# 3563|       /* margins */
# 3564|       pname = "MarginLeft";
# 3565|->     code = param_read_string(plist, pname, &mlps);
# 3566|       switch (code) {
# 3567|       case 0:

Error: CPPCHECK_WARNING (CWE-401): [#def33]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3568: error[memleakOnRealloc]: Common realloc mistake: 'buff' nulled but not freed upon failure
# 3566|       switch (code) {
# 3567|       case 0:
# 3568|->         buff = realloc(buff, mlps.size + 1);
# 3569|           memcpy(buff, mlps.data, mlps.size);
# 3570|           buff[mlps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def34]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3568:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3568:16: danger: second ‘free’ here
# 3566|       switch (code) {
# 3567|       case 0:
# 3568|->         buff = realloc(buff, mlps.size + 1);
# 3569|           memcpy(buff, mlps.data, mlps.size);
# 3570|           buff[mlps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def35]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3569:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3569:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3567|       case 0:
# 3568|           buff = realloc(buff, mlps.size + 1);
# 3569|->         memcpy(buff, mlps.data, mlps.size);
# 3570|           buff[mlps.size] = 0;
# 3571|           opdev->globals.margins[0] = atof(buff);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3577:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3577:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/3)
# 3575|       default:
# 3576|           ecode = code;
# 3577|->         param_signal_error(plist, pname, ecode);
# 3578|       }
# 3579|       pname = "MarginTop";

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3580:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3580:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3580:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/3)
# 3578|       }
# 3579|       pname = "MarginTop";
# 3580|->     code = param_read_string(plist, pname, &mtps);
# 3581|       switch (code) {
# 3582|       case 0:

Error: CPPCHECK_WARNING (CWE-401): [#def38]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3583: error[memleakOnRealloc]: Common realloc mistake: 'buff' nulled but not freed upon failure
# 3581|       switch (code) {
# 3582|       case 0:
# 3583|->         buff = realloc(buff, mtps.size + 1);
# 3584|           memcpy(buff, mtps.data, mtps.size);
# 3585|           buff[mtps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def39]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3583:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3583:16: danger: second ‘free’ here
# 3581|       switch (code) {
# 3582|       case 0:
# 3583|->         buff = realloc(buff, mtps.size + 1);
# 3584|           memcpy(buff, mtps.data, mtps.size);
# 3585|           buff[mtps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def40]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3584:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3584:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3582|       case 0:
# 3583|           buff = realloc(buff, mtps.size + 1);
# 3584|->         memcpy(buff, mtps.data, mtps.size);
# 3585|           buff[mtps.size] = 0;
# 3586|           opdev->globals.margins[3] = atof(buff);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3592:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3592:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3592:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/3)
# 3590|       default:
# 3591|           ecode = code;
# 3592|->         param_signal_error(plist, pname, ecode);
# 3593|       }
# 3594|       pname = "MarginRight";

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3595:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3595:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3595:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/3)
# 3593|       }
# 3594|       pname = "MarginRight";
# 3595|->     code = param_read_string(plist, pname, &mrps);
# 3596|       switch (code) {
# 3597|       case 0:

Error: CPPCHECK_WARNING (CWE-401): [#def43]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3598: error[memleakOnRealloc]: Common realloc mistake: 'buff' nulled but not freed upon failure
# 3596|       switch (code) {
# 3597|       case 0:
# 3598|->         buff = realloc(buff, mrps.size + 1);
# 3599|           memcpy(buff, mrps.data, mrps.size);
# 3600|           buff[mrps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def44]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3598:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3598:16: danger: second ‘free’ here
# 3596|       switch (code) {
# 3597|       case 0:
# 3598|->         buff = realloc(buff, mrps.size + 1);
# 3599|           memcpy(buff, mrps.data, mrps.size);
# 3600|           buff[mrps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def45]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3599:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3599:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3597|       case 0:
# 3598|           buff = realloc(buff, mrps.size + 1);
# 3599|->         memcpy(buff, mrps.data, mrps.size);
# 3600|           buff[mrps.size] = 0;
# 3601|           opdev->globals.margins[2] = atof(buff);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3607:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3607:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3607:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/3)
# 3605|       default:
# 3606|           ecode = code;
# 3607|->         param_signal_error(plist, pname, ecode);
# 3608|       }
# 3609|       pname = "MarginBottom";

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3610:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3610:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3610:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/3)
# 3608|       }
# 3609|       pname = "MarginBottom";
# 3610|->     code = param_read_string(plist, pname, &mbps);
# 3611|       switch (code) {
# 3612|       case 0:

Error: CPPCHECK_WARNING (CWE-401): [#def48]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3613: error[memleakOnRealloc]: Common realloc mistake: 'buff' nulled but not freed upon failure
# 3611|       switch (code) {
# 3612|       case 0:
# 3613|->         buff = realloc(buff, mbps.size + 1);
# 3614|           memcpy(buff, mbps.data, mbps.size);
# 3615|           buff[mbps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def49]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3613:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3613:16: danger: second ‘free’ here
# 3611|       switch (code) {
# 3612|       case 0:
# 3613|->         buff = realloc(buff, mbps.size + 1);
# 3614|           memcpy(buff, mbps.data, mbps.size);
# 3615|           buff[mbps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def50]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3614:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3614:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3612|       case 0:
# 3613|           buff = realloc(buff, mbps.size + 1);
# 3614|->         memcpy(buff, mbps.data, mbps.size);
# 3615|           buff[mbps.size] = 0;
# 3616|           opdev->globals.margins[1] = atof(buff);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3622:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3622:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3622:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/3)
# 3620|       default:
# 3621|           ecode = code;
# 3622|->         param_signal_error(plist, pname, ecode);
# 3623|       }
# 3624|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3627:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3627:12: throw: if ‘param_read_string’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3627:12: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/3)
# 3625|       /* zoom */
# 3626|       pname = "Zoom";
# 3627|->     code = param_read_string(plist, pname, &zmps);
# 3628|       switch (code) {
# 3629|       case 0:

Error: CPPCHECK_WARNING (CWE-401): [#def53]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3630: error[memleakOnRealloc]: Common realloc mistake: 'buff' nulled but not freed upon failure
# 3628|       switch (code) {
# 3629|       case 0:
# 3630|->         buff = realloc(buff, zmps.size + 1);
# 3631|           memcpy(buff, zmps.data, zmps.size);
# 3632|           buff[zmps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def54]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3630:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: passing freed pointer ‘buff’ in call to ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3630:16: danger: second ‘free’ here
# 3628|       switch (code) {
# 3629|       case 0:
# 3630|->         buff = realloc(buff, zmps.size + 1);
# 3631|           memcpy(buff, zmps.data, zmps.size);
# 3632|           buff[zmps.size] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def55]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3631:9: warning[-Wanalyzer-null-argument]: use of NULL ‘buff’ where non-null expected
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3522:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3631:9: danger: argument 1 (‘buff’) NULL where non-null expected
# 3629|       case 0:
# 3630|           buff = realloc(buff, zmps.size + 1);
# 3631|->         memcpy(buff, zmps.data, zmps.size);
# 3632|           buff[zmps.size] = 0;
# 3633|           if (strncasecmp(buff, "Auto", 4)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3649:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3649:9: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3649:9: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/3)
# 3647|       default:
# 3648|           ecode = code;
# 3649|->         param_signal_error(plist, pname, ecode);
# 3650|       }
# 3651|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3655:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buff’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3436:1: enter_function: entry to ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: call_function: calling ‘opvp_alloc_string’ from ‘_put_params’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3468:9: return_function: returning to ‘_put_params’ from ‘opvp_alloc_string’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3652:8: branch_false: following ‘false’ branch (when ‘buff’ is NULL)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3463:13: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:3655:1: danger: ‘buff’ leaks here; was allocated at [(4)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/3)
# 3653|   
# 3654|       return ecode;
# 3655|-> }
# 3656|   
# 3657|   /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: warning[-Wanalyzer-malloc-leak]: leak of ‘points’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5069:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5076:14: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_true: following ‘true’ branch (when ‘begin != 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5085:23: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5158:9: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: throw: if ‘gx_path_enum_next’ throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: danger: ‘points’ leaks here; was allocated at [(7)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/6)
# 5080|   
# 5081|       while (!ecode) {
# 5082|->         op = gx_path_enum_next(&path, (gs_fixed_point *)vs);
# 5083|           if (begin) {
# 5084|               /* start point */

Error: CPPCHECK_WARNING (CWE-401): [#def59]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5091: error[memleakOnRealloc]: Common realloc mistake: 'points' nulled but not freed upon failure
# 5089|   #ifdef  OPVP_OPT_MULTI_PATH
# 5090|               npoints = 1;
# 5091|->             points = realloc(points, sizeof(_fPoint));
# 5092|               current = start;
# 5093|   #endif

Error: GCC_ANALYZER_WARNING (CWE-476): [#def60]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5095:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘points’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5069:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5076:14: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_true: following ‘true’ branch (when ‘begin != 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5085:23: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5095:13: danger: dereference of NULL ‘points’
# 5093|   #endif
# 5094|   
# 5095|->             points[0] = start;
# 5096|   
# 5097|   #ifdef  OPVP_OPT_MULTI_PATH

Error: CPPCHECK_WARNING (CWE-401): [#def61]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5100: error[memleakOnRealloc]: Common realloc mistake: 'opvp_p' nulled but not freed upon failure
# 5098|           } else if (op != pop) {
# 5099|               /* convert float to Fix */
# 5100|->             opvp_p = realloc(opvp_p, sizeof(opvp_point_t) * npoints);
# 5101|               for (i = 0; i < npoints; i++) {
# 5102|                   OPVP_F2FIX(points[i].x, opvp_p[i].x);

Error: GCC_ANALYZER_WARNING (CWE-415): [#def62]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5100:22: warning[-Wanalyzer-double-free]: double-‘free’ of ‘opvp_p’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5069:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5076:14: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_true: following ‘true’ branch (when ‘begin != 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5085:23: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5158:9: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_false: following ‘false’ branch (when ‘begin == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5098:19: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5098:19: branch_true: following ‘true’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5100:22: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5100:22: danger: second ‘free’ here
# 5098|           } else if (op != pop) {
# 5099|               /* convert float to Fix */
# 5100|->             opvp_p = realloc(opvp_p, sizeof(opvp_point_t) * npoints);
# 5101|               for (i = 0; i < npoints; i++) {
# 5102|                   OPVP_F2FIX(points[i].x, opvp_p[i].x);

Error: CPPCHECK_WARNING (CWE-401): [#def63]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5151: error[memleakOnRealloc]: Common realloc mistake: 'points' nulled but not freed upon failure
# 5149|               /* reset */
# 5150|               npoints = 1;
# 5151|->             points = realloc(points, sizeof(_fPoint));
# 5152|               points[0] = current;
# 5153|   #endif

Error: GCC_ANALYZER_WARNING (CWE-415): [#def64]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5164:22: warning[-Wanalyzer-double-free]: double-‘free’ of ‘points’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5069:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5076:14: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_true: following ‘true’ branch (when ‘begin != 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5085:23: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5158:9: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_false: following ‘false’ branch (when ‘begin == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5098:19: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5098:19: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5158:9: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5164:22: danger: second ‘free’ here
# 5162|               i = npoints;
# 5163|               npoints += 1;
# 5164|->             points = realloc(points, sizeof(_fPoint) * npoints);
# 5165|               points[i].x = fixed2float(vs[0]) / scale.x;
# 5166|               points[i].y = fixed2float(vs[1]) / scale.y;

Error: CPPCHECK_WARNING (CWE-401): [#def65]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5191: error[memleakOnRealloc]: Common realloc mistake: 'points' nulled but not freed upon failure
# 5189|               i = npoints;
# 5190|               npoints += 1;
# 5191|->             points = realloc(points, sizeof(_fPoint) * npoints);
# 5192|               points[i].x = fixed2float(vs[0]) / scale.x;
# 5193|               points[i].y = fixed2float(vs[1]) / scale.y;

Error: CPPCHECK_WARNING (CWE-401): [#def66]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5215: error[memleakOnRealloc]: Common realloc mistake: 'points' nulled but not freed upon failure
# 5213|               i = npoints;
# 5214|               npoints += 3;
# 5215|->             points = realloc(points, sizeof(_fPoint) * npoints);
# 5216|               points[i  ].x = fixed2float(vs[0]) / scale.x;
# 5217|               points[i  ].y = fixed2float(vs[1]) / scale.y;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5247:20: warning[-Wanalyzer-malloc-leak]: leak of ‘points’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5069:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5076:14: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_true: following ‘true’ branch (when ‘begin != 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5085:23: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5158:9: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5247:20: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5247:20: danger: ‘points’ leaks here; was allocated at [(7)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/6)
# 5245|           case gs_pe_closepath:
# 5246|               /* close path */
# 5247|->             code = (*vdev_proc(vdev, closepath))(
# 5248|                          vdev,
# 5249|                          points[0].x,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5272:12: warning[-Wanalyzer-malloc-leak]: leak of ‘points’
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5069:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5076:14: branch_false: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5081:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5082:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5083:12: branch_true: following ‘true’ branch (when ‘begin != 0’)...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5085:23: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5156:12: branch_true: following ‘true’ branch...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5272:14: branch_true: ...to here
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5272:12: throw: if the called function throws an exception...
ghostscript-10.05.1/contrib/opvp/gdevopvp.c:5272:12: danger: ‘points’ leaks here; was allocated at [(7)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/6)
# 5270|   
# 5271|       /* end path */
# 5272|->     code = (*vdev_proc(vdev, endpath))(vdev, type);
# 5273|       if (code) ecode = code;
# 5274|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def69]
ghostscript-10.05.1/devices/gxfcopy.c:515:13: warning[-Wanalyzer-null-argument]: use of NULL ‘prefix’ where non-null expected
ghostscript-10.05.1/devices/gxfcopy.c:1059:1: enter_function: entry to ‘copy_glyph_type1’
ghostscript-10.05.1/devices/gxfcopy.c:1068:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/devices/gxfcopy.c:1070:12: branch_false: ...to here
ghostscript-10.05.1/devices/gxfcopy.c:1070:12: call_function: calling ‘copy_glyph_data’ from ‘copy_glyph_type1’
#  513|           if ((options & COPY_GLYPH_NO_OLD) ||
#  514|               pcg->gdata.size != prefix_bytes + size ||
#  515|->             memcmp(pcg->gdata.data, prefix, prefix_bytes) ||
#  516|               memcmp(pcg->gdata.data + prefix_bytes,
#  517|                      pgdata->bits.data, size)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1406:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1454:1: enter_function: entry to ‘even_better_line’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1470:19: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1472:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1472:34: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1473:11: call_function: calling ‘even_better_compress_rll’ from ‘even_better_line’
# 1404|             if (count > 0xffff - whole || val != last_val)
# 1405|               {
# 1406|->               dst[rll_idx].length = count;
# 1407|                 dst[rll_idx].value = last_val;
# 1408|                 rll_idx++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def71]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1424:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1454:1: enter_function: entry to ‘even_better_line’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1470:19: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1472:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1472:34: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1473:11: call_function: calling ‘even_better_compress_rll’ from ‘even_better_line’
# 1422|             if (count >= 0xffff - whole || val != last_val)
# 1423|               {
# 1424|->               dst[rll_idx].length = count;
# 1425|                 dst[rll_idx].value = last_val;
# 1426|                 rll_idx++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def72]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1439:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1454:1: enter_function: entry to ‘even_better_line’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1470:19: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1472:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1472:34: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1473:11: call_function: calling ‘even_better_compress_rll’ from ‘even_better_line’
# 1437|           }
# 1438|       }
# 1439|->   dst[rll_idx].length = count;
# 1440|     dst[rll_idx].value = last_val;
# 1441|     rll_idx++;

Error: CPPCHECK_WARNING (CWE-476): [#def73]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1543: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ebc
# 1541|     char *rs_lut;
# 1542|     double rbscale = eb_compute_rbscale(params);
# 1543|->   int even_c1 = ebc->even_c1;
# 1544|     int even_rlimit = 1 << (30 - EVEN_SHIFT + even_c1);
# 1545|     int do_shadows = params->do_shadows;

Error: CPPCHECK_WARNING (CWE-476): [#def74]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1551: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1549|     result = (EBPlaneCtx *)malloc (sizeof(EBPlaneCtx));
# 1550|   
# 1551|->   result->source_width = source_width;
# 1552|     result->dest_width = dest_width;
# 1553|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def75]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1551:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1549:26: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1551:3: danger: ‘result’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1549|     result = (EBPlaneCtx *)malloc (sizeof(EBPlaneCtx));
# 1550|   
# 1551|->   result->source_width = source_width;
# 1552|     result->dest_width = dest_width;
# 1553|   

Error: CPPCHECK_WARNING (CWE-476): [#def76]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1552: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1550|   
# 1551|     result->source_width = source_width;
# 1552|->   result->dest_width = dest_width;
# 1553|   
# 1554|     new_lut = (int *)malloc ((ET_SRC_MAX + 1) * sizeof(int));

Error: CPPCHECK_WARNING (CWE-476): [#def77]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1569: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_lut
# 1567|         else
# 1568|           nli = lut[i] >> (24 - EVEN_SHIFT);
# 1569|->       new_lut[i] = (1 << EVEN_SHIFT) - nli;
# 1570|       }
# 1571|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def78]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1569:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_lut’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1554:20: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1569:7: danger: ‘new_lut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1567|         else
# 1568|           nli = lut[i] >> (24 - EVEN_SHIFT);
# 1569|->       new_lut[i] = (1 << EVEN_SHIFT) - nli;
# 1570|       }
# 1571|   

Error: CPPCHECK_WARNING (CWE-476): [#def79]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_lut
# 1579|       {
# 1580|         double rb;
# 1581|->       int nl = new_lut[i] * (params->levels - 1);
# 1582|         int rs;
# 1583|   

Error: CPPCHECK_WARNING (CWE-476): [#def80]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1594: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rs_lut
# 1592|   
# 1593|         rs = eb_compute_randshift(nl, rs_base, do_shadows, params->levels);
# 1594|->       rs_lut[i] = rs;
# 1595|   
# 1596|         if (params->do_shadows)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def81]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1594:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rs_lut’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1573:20: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1594:7: danger: ‘rs_lut + (long unsigned int)i’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
# 1592|   
# 1593|         rs = eb_compute_randshift(nl, rs_base, do_shadows, params->levels);
# 1594|->       rs_lut[i] = rs;
# 1595|   
# 1596|         if (params->do_shadows)

Error: CPPCHECK_WARNING (CWE-476): [#def82]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rb_lut
# 1609|               }
# 1610|           }
# 1611|->       rb_lut[i] = rb;
# 1612|   
# 1613|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def83]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rb_lut’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1572:19: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:7: danger: ‘rb_lut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1609|               }
# 1610|           }
# 1611|->       rb_lut[i] = rb;
# 1612|   
# 1613|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def84]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)dest_width, 4)’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_false: following ‘false’ branch (when ‘i == 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1615:3: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1622:27: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1625:6: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1627:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1637:15: branch_true: following ‘true’ branch (when ‘i < dest_width’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:7: danger: ‘calloc((long unsigned int)dest_width, 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(25)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/24)
# 1637|     for (i = 0; i < dest_width; i++)
# 1638|       {
# 1639|->       result->a_line[i] = 1;
# 1640|         result->b_line[i] = 1;
# 1641|         result->iir_line[i] = -((rand () & 0x7fff) << 6) >> (24 - EVEN_SHIFT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def85]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1640:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)dest_width, 4)’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_false: following ‘false’ branch (when ‘i == 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1615:3: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1623:27: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1625:6: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1627:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1637:15: branch_true: following ‘true’ branch (when ‘i < dest_width’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1640:7: danger: ‘calloc((long unsigned int)dest_width, 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(25)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/24)
# 1638|       {
# 1639|         result->a_line[i] = 1;
# 1640|->       result->b_line[i] = 1;
# 1641|         result->iir_line[i] = -((rand () & 0x7fff) << 6) >> (24 - EVEN_SHIFT);
# 1642|         if (do_shadows)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1641:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)dest_width, 4)’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_false: following ‘false’ branch (when ‘i == 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1615:3: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1620:29: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1625:6: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1627:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1637:15: branch_true: following ‘true’ branch (when ‘i < dest_width’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1641:7: danger: ‘calloc((long unsigned int)dest_width, 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(25)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/24)
# 1639|         result->a_line[i] = 1;
# 1640|         result->b_line[i] = 1;
# 1641|->       result->iir_line[i] = -((rand () & 0x7fff) << 6) >> (24 - EVEN_SHIFT);
# 1642|         if (do_shadows)
# 1643|           {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1644:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*result.a_line_sh + (long unsigned int)i * 4’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_false: following ‘false’ branch (when ‘i == 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1615:3: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1625:6: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1627:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1628:34: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1637:15: branch_true: following ‘true’ branch (when ‘i < dest_width’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1642:10: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1644:11: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1644:11: danger: ‘*result.a_line_sh + (long unsigned int)i * 4’ could be NULL: unchecked value from [(27)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/26)
# 1642|         if (do_shadows)
# 1643|           {
# 1644|->           result->a_line_sh[i] = 1;
# 1645|             result->b_line_sh[i] = 1;
# 1646|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1645:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*result.b_line_sh + (long unsigned int)i * 4’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1555:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1559:10: branch_true: following ‘true’ branch (when ‘lut’ is NULL)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1562:18: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1581:23: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1584:10: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1593:12: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1596:10: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1598:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1600:14: branch_true: following ‘true’ branch (when ‘nl == 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1611:13: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1578:15: branch_false: following ‘false’ branch (when ‘i == 256’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1615:3: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1625:6: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1627:34: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1629:34: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1637:15: branch_true: following ‘true’ branch (when ‘i < dest_width’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1639:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1642:10: branch_true: following ‘true’ branch (when ‘do_shadows != 0’)...
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1644:11: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1645:11: danger: ‘*result.b_line_sh + (long unsigned int)i * 4’ could be NULL: unchecked value from [(27)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/26)
# 1643|           {
# 1644|             result->a_line_sh[i] = 1;
# 1645|->           result->b_line_sh[i] = 1;
# 1646|           }
# 1647|       }

Error: CPPCHECK_WARNING (CWE-476): [#def89]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1686: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1684|       }
# 1685|   
# 1686|->   result->source_width = params->source_width;
# 1687|     result->dest_width = params->dest_width;
# 1688|     result->n_planes = n_planes;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1686:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1655:44: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1686:3: danger: ‘result’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
# 1684|       }
# 1685|   
# 1686|->   result->source_width = params->source_width;
# 1687|     result->dest_width = params->dest_width;
# 1688|     result->n_planes = n_planes;

Error: CPPCHECK_WARNING (CWE-476): [#def91]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1687: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1685|   
# 1686|     result->source_width = params->source_width;
# 1687|->   result->dest_width = params->dest_width;
# 1688|     result->n_planes = n_planes;
# 1689|     result->levels = params->levels;

Error: CPPCHECK_WARNING (CWE-476): [#def92]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1688: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1686|     result->source_width = params->source_width;
# 1687|     result->dest_width = params->dest_width;
# 1688|->   result->n_planes = n_planes;
# 1689|     result->levels = params->levels;
# 1690|   

Error: CPPCHECK_WARNING (CWE-476): [#def93]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1689: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1687|     result->dest_width = params->dest_width;
# 1688|     result->n_planes = n_planes;
# 1689|->   result->levels = params->levels;
# 1690|   
# 1691|     result->aspect = params->aspect;

Error: CPPCHECK_WARNING (CWE-476): [#def94]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1691: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1689|     result->levels = params->levels;
# 1690|   
# 1691|->   result->aspect = params->aspect;
# 1692|   
# 1693|     result->even_ehi = 0.6 * (1 << EVEN_SHIFT) / (params->levels - 1);

Error: CPPCHECK_WARNING (CWE-476): [#def95]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1693: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1691|     result->aspect = params->aspect;
# 1692|   
# 1693|->   result->even_ehi = 0.6 * (1 << EVEN_SHIFT) / (params->levels - 1);
# 1694|     result->even_elo = -result->even_ehi;
# 1695|   

Error: CPPCHECK_WARNING (CWE-476): [#def96]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1694: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1692|   
# 1693|     result->even_ehi = 0.6 * (1 << EVEN_SHIFT) / (params->levels - 1);
# 1694|->   result->even_elo = -result->even_ehi;
# 1695|   
# 1696|     result->strengths = (int *)malloc (sizeof(int) * n_planes);

Error: CPPCHECK_WARNING (CWE-476): [#def97]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1696: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1694|     result->even_elo = -result->even_ehi;
# 1695|   
# 1696|->   result->strengths = (int *)malloc (sizeof(int) * n_planes);
# 1697|     memcpy (result->strengths, params->strengths,
# 1698|             sizeof(int) * n_planes);

Error: CPPCHECK_WARNING (CWE-476): [#def98]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1697: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1695|   
# 1696|     result->strengths = (int *)malloc (sizeof(int) * n_planes);
# 1697|->   memcpy (result->strengths, params->strengths,
# 1698|             sizeof(int) * n_planes);
# 1699|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def99]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1697:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)n_planes * 4)’ where non-null expected
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1696:30: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1697:3: danger: argument 1 (‘malloc((long unsigned int)n_planes * 4)’) from [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
# 1695|   
# 1696|     result->strengths = (int *)malloc (sizeof(int) * n_planes);
# 1697|->   memcpy (result->strengths, params->strengths,
# 1698|             sizeof(int) * n_planes);
# 1699|   

Error: CPPCHECK_WARNING (CWE-476): [#def100]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1702: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1700|     log2_levels = even_log2 (params->levels);
# 1701|     log2_aspect = even_log2 (params->aspect);
# 1702|->   result->even_c1 = 6 + log2_aspect + log2_levels - params->even_c1_scale;
# 1703|     result->do_shadows = params->do_shadows;
# 1704|   

Error: CPPCHECK_WARNING (CWE-476): [#def101]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1703: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1701|     log2_aspect = even_log2 (params->aspect);
# 1702|     result->even_c1 = 6 + log2_aspect + log2_levels - params->even_c1_scale;
# 1703|->   result->do_shadows = params->do_shadows;
# 1704|   
# 1705|     result->c_line = (int *)calloc (params->dest_width, sizeof(int));

Error: CPPCHECK_WARNING (CWE-476): [#def102]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1705: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1703|     result->do_shadows = params->do_shadows;
# 1704|   
# 1705|->   result->c_line = (int *)calloc (params->dest_width, sizeof(int));
# 1706|   
# 1707|     result->seed1 = 0x5324879f;

Error: CPPCHECK_WARNING (CWE-476): [#def103]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1707: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1705|     result->c_line = (int *)calloc (params->dest_width, sizeof(int));
# 1706|   
# 1707|->   result->seed1 = 0x5324879f;
# 1708|     result->seed2 = 0xb78d0945;
# 1709|   

Error: CPPCHECK_WARNING (CWE-476): [#def104]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1708: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1706|   
# 1707|     result->seed1 = 0x5324879f;
# 1708|->   result->seed2 = 0xb78d0945;
# 1709|   
# 1710|     result->dump_file = params->dump_file;

Error: CPPCHECK_WARNING (CWE-476): [#def105]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1710: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1708|     result->seed2 = 0xb78d0945;
# 1709|   
# 1710|->   result->dump_file = params->dump_file;
# 1711|     result->dump_level = params->dump_level;
# 1712|   

Error: CPPCHECK_WARNING (CWE-476): [#def106]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1711: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1709|   
# 1710|     result->dump_file = params->dump_file;
# 1711|->   result->dump_level = params->dump_level;
# 1712|   
# 1713|   #ifdef USE_SSE2

Error: CPPCHECK_WARNING (CWE-476): [#def107]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1752: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1750|     else
# 1751|       {
# 1752|->       result->plane_ctx = (EBPlaneCtx **)malloc(sizeof(EBPlaneCtx *) * n_planes);
# 1753|         for (i = 0; i < n_planes; i++)
# 1754|           result->plane_ctx[i] = even_better_plane_new (params, result, i);

Error: CPPCHECK_WARNING (CWE-476): [#def108]
ghostscript-10.05.1/devices/rinkj/evenbetter-rll.c:1754: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1752|         result->plane_ctx = (EBPlaneCtx **)malloc(sizeof(EBPlaneCtx *) * n_planes);
# 1753|         for (i = 0; i < n_planes; i++)
# 1754|->         result->plane_ctx[i] = even_better_plane_new (params, result, i);
# 1755|       }
# 1756|     return result;

Error: CPPCHECK_WARNING (CWE-476): [#def109]
ghostscript-10.05.1/devices/rinkj/rinkj-byte-stream.c:104: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  102|     result = (RinkjByteStreamFile *)malloc (sizeof (RinkjByteStreamFile));
#  103|   
#  104|->   result->super.write = rinkj_byte_stream_file_write;
#  105|     result->f = f;
#  106|   

Error: CPPCHECK_WARNING (CWE-476): [#def110]
ghostscript-10.05.1/devices/rinkj/rinkj-byte-stream.c:105: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  103|   
#  104|     result->super.write = rinkj_byte_stream_file_write;
#  105|->   result->f = f;
#  106|   
#  107|     return &result->super;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
ghostscript-10.05.1/devices/rinkj/rinkj-byte-stream.c:105:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’
ghostscript-10.05.1/devices/rinkj/rinkj-byte-stream.c:102:35: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-byte-stream.c:105:3: danger: ‘result’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  103|   
#  104|     result->super.write = rinkj_byte_stream_file_write;
#  105|->   result->f = f;
#  106|   
#  107|     return &result->super;

Error: CPPCHECK_WARNING (CWE-476): [#def112]
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:41: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#   39|   
#   40|     result = malloc (size + 1);
#   41|->   memcpy (result, src, size);
#   42|     result[size] = 0;
#   43|     return result;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def113]
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:41:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:109:1: enter_function: entry to ‘rinkj_config_keyval’
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:115:6: branch_false: following ‘false’ branch (when ‘config’ is non-NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:115:6: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:118:16: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:123:14: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:124:10: branch_true: following ‘true’ branch (when ‘p_nl’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:127:20: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:136:24: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:138:22: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:138:14: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:140:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:140:21: call_function: calling ‘rinkj_strdup_size’ from ‘rinkj_config_keyval’
#   39|   
#   40|     result = malloc (size + 1);
#   41|->   memcpy (result, src, size);
#   42|     result[size] = 0;
#   43|     return result;

Error: CPPCHECK_WARNING (CWE-476): [#def114]
ghostscript-10.05.1/devices/rinkj/rinkj-config.c:42: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#   40|     result = malloc (size + 1);
#   41|     memcpy (result, src, size);
#   42|->   result[size] = 0;
#   43|     return result;
#   44|   }

Error: CPPCHECK_WARNING (CWE-476): [#def115]
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:45: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#   43|     /* This implementation is in terms of device_set, but we're going to
#   44|        change the prototype of the device so this is native. */
#   45|->   memcpy (buf, key, keylen);
#   46|     memcpy (buf + keylen, ": ", 2);
#   47|     memcpy (buf + keylen + 2, value, value_size);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def116]
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:45:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:40:15: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:45:3: danger: argument 1 (‘buf’) from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   43|     /* This implementation is in terms of device_set, but we're going to
#   44|        change the prototype of the device so this is native. */
#   45|->   memcpy (buf, key, keylen);
#   46|     memcpy (buf + keylen, ": ", 2);
#   47|     memcpy (buf + keylen + 2, value, value_size);

Error: CPPCHECK_WARNING (CWE-682): [#def117]
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:46: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#   44|        change the prototype of the device so this is native. */
#   45|     memcpy (buf, key, keylen);
#   46|->   memcpy (buf + keylen, ": ", 2);
#   47|     memcpy (buf + keylen + 2, value, value_size);
#   48|     buf[keylen + 2 + value_size] = 0;

Error: CPPCHECK_WARNING (CWE-682): [#def118]
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:47: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#   45|     memcpy (buf, key, keylen);
#   46|     memcpy (buf + keylen, ": ", 2);
#   47|->   memcpy (buf + keylen + 2, value, value_size);
#   48|     buf[keylen + 2 + value_size] = 0;
#   49|     status = rinkj_device_set (self, buf);

Error: CPPCHECK_WARNING (CWE-476): [#def119]
ghostscript-10.05.1/devices/rinkj/rinkj-device.c:48: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#   46|     memcpy (buf + keylen, ": ", 2);
#   47|     memcpy (buf + keylen + 2, value, value_size);
#   48|->   buf[keylen + 2 + value_size] = 0;
#   49|     status = rinkj_device_set (self, buf);
#   50|     free (buf);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def120]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:586:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  584|         s0 = src[i * 2] << pass;
#  585|         s1 = src[i * 2 + 1] << pass;
#  586|->       dst[i] = (s0 & 0x80) | ((s0 & 0x20) << 1) | ((s0 & 8) << 2) | ((s0 & 2) << 3) |
#  587|           ((s1 & 0x80) >> 4) | ((s1 & 0x20) >> 3) | ((s1 & 8) >> 2) | ((s1 & 2) >> 1);
#  588|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:622:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  620|         s2 = src[i * 4 + 2] << shift;
#  621|         s3 = src[i * 4 + 3] << shift;
#  622|->       dst[i] = (s0 & 0x80) | ((s0 & 8) << 3) |
#  623|           ((s1 & 0x80) >> 2) | ((s1 & 8) << 1) |
#  624|           ((s2 & 0x80) >> 4) | ((s2 & 8) >> 1) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def122]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:664:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  662|         s0 = src[i * 2] << shift;
#  663|         s1 = src[i * 2 + 1] << shift;
#  664|->       dst[i] = (s0 & 0xc0) | ((s0 & 0x0c) << 2) |
#  665|           ((s1 & 0xc0) >> 4) | ((s1 & 0x0c) >> 2);
#  666|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def123]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:670:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  668|       {
#  669|         s0 = src[n_bytes - 1] << shift;
#  670|->       dst[i] = (s0 & 0xc0) | ((s0 & 0x0c) << 2);
#  671|       }
#  672|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def124]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:700:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  698|         s2 = src[i * 4 + 2] << shift;
#  699|         s3 = src[i * 4 + 3] << shift;
#  700|->       dst[i] = (s0 & 0xc0) | ((s1 & 0xc0) >> 2) |
#  701|           ((s2 & 0xc0) >> 4) | ((s3 & 0xc0) >> 6);
#  702|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def125]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:724:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  722|       {
#  723|         unsigned char s = src[i];
#  724|->       dst[i * 2] = (((s & 0x80) >> 1) | ((s & 0x40) >> 2) |
#  725|                       ((s & 0x20) >> 3) | ((s & 0x10) >> 4)) * DOT;
#  726|         dst[i * 2 + 1] = (((s & 8) << 3) | ((s & 4) << 2) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def126]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:737:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  735|   
#  736|     for (i = 0; i < n_bytes; i++)
#  737|->     dst[i] = (src[i] >> (1 - x_pass) & 0x55) * DOT;
#  738|   }
#  739|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:752:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  750|         s0 = src[i * 2] << pass;
#  751|         s1 = src[i * 2 + 1] << pass;
#  752|->       dst[i] = (((s0 & 0x80) >> 1) | ((s0 & 8) << 1) |
#  753|           ((s1 & 0x80) >> 5) | ((s1 & 0x8) >> 3)) * DOT;
#  754|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def128]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:769:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dst’ where non-null expected
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  767|       {
#  768|         if (passes_per_scan == 1)
#  769|->         memcpy (dst, src, n_bytes);
#  770|         else if (passes_per_scan == 2)
#  771|           rinkj_escp_shuffle_2pass_2bit (dst, src, pass, n_bytes);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def129]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:787:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dst’ where non-null expected
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  785|       {
#  786|         if (passes_per_scan == 1)
#  787|->         memcpy (dst, src, n_bytes);
#  788|         else if (passes_per_scan == 2)
#  789|           rinkj_escp_shuffle_dblx (dst, src, pass, n_bytes);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def130]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:816:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘src’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  814|     for (i = 0; i < n; i += run)
#  815|       {
#  816|->       b = src[i];
#  817|         for (run = 1; run < 129 && i + run < n; run++)
#  818|           if (b != src[i + run])

Error: GCC_ANALYZER_WARNING (CWE-476): [#def131]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:834:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dst’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  832|                   break;
#  833|               }
#  834|->           dst[j++] = run - 1;
#  835|             memcpy (dst + j, src + i, run);
#  836|             j += run;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def132]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:951:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘thisbuf’ where non-null expected
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1020:1: enter_function: entry to ‘rinkj_escp_write’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1030:6: branch_true: following ‘true’ branch (when ‘data’ is NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1032:16: call_function: calling ‘rinkj_escp_flush_bottom’ from ‘rinkj_escp_write’
#  949|                                   z->passes_per_scan, z->bps, z->head_bps);
#  950|             else
#  951|->             memset (thisbuf, 0, xsb_out);
#  952|             z->buf_linevalid[bufy * z->num_chan + i] &= ~pass_mask;
#  953|   #ifdef VERBOSE

Error: CPPCHECK_WARNING (CWE-476): [#def133]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1066: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1064|     result = (RinkjEscp *)malloc (sizeof (RinkjEscp));
# 1065|   
# 1066|->   result->super.set = rinkj_escp_set;
# 1067|     result->super.write = rinkj_escp_write;
# 1068|     result->super.init = rinkj_escp_init;

Error: CPPCHECK_WARNING (CWE-476): [#def134]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1067: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1065|   
# 1066|     result->super.set = rinkj_escp_set;
# 1067|->   result->super.write = rinkj_escp_write;
# 1068|     result->super.init = rinkj_escp_init;
# 1069|     result->super.init_happened = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def135]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1068: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1066|     result->super.set = rinkj_escp_set;
# 1067|     result->super.write = rinkj_escp_write;
# 1068|->   result->super.init = rinkj_escp_init;
# 1069|     result->super.init_happened = 0;
# 1070|     result->width = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def136]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1069: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1067|     result->super.write = rinkj_escp_write;
# 1068|     result->super.init = rinkj_escp_init;
# 1069|->   result->super.init_happened = 0;
# 1070|     result->width = 0;
# 1071|     result->out = out;

Error: CPPCHECK_WARNING (CWE-476): [#def137]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1070: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1068|     result->super.init = rinkj_escp_init;
# 1069|     result->super.init_happened = 0;
# 1070|->   result->width = 0;
# 1071|     result->out = out;
# 1072|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def138]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1070:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1064:25: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1070:3: danger: ‘result’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
# 1068|     result->super.init = rinkj_escp_init;
# 1069|     result->super.init_happened = 0;
# 1070|->   result->width = 0;
# 1071|     result->out = out;
# 1072|   

Error: CPPCHECK_WARNING (CWE-476): [#def139]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1071: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1069|     result->super.init_happened = 0;
# 1070|     result->width = 0;
# 1071|->   result->out = out;
# 1072|   
# 1073|     result->num_chan = 4;

Error: CPPCHECK_WARNING (CWE-476): [#def140]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1073: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1071|     result->out = out;
# 1072|   
# 1073|->   result->num_chan = 4;
# 1074|     result->bps = 1;
# 1075|   

Error: CPPCHECK_WARNING (CWE-476): [#def141]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1074: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1072|   
# 1073|     result->num_chan = 4;
# 1074|->   result->bps = 1;
# 1075|   
# 1076|     result->manufacturer = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def142]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1076: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1074|     result->bps = 1;
# 1075|   
# 1076|->   result->manufacturer = NULL;
# 1077|     result->model = NULL;
# 1078|   

Error: CPPCHECK_WARNING (CWE-476): [#def143]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1077: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1075|   
# 1076|     result->manufacturer = NULL;
# 1077|->   result->model = NULL;
# 1078|   
# 1079|     result->autocut = -1;

Error: CPPCHECK_WARNING (CWE-476): [#def144]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1079: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1077|     result->model = NULL;
# 1078|   
# 1079|->   result->autocut = -1;
# 1080|     result->microdot = -1;
# 1081|     result->unidir = -1;

Error: CPPCHECK_WARNING (CWE-476): [#def145]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1080: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1078|   
# 1079|     result->autocut = -1;
# 1080|->   result->microdot = -1;
# 1081|     result->unidir = -1;
# 1082|     result->printer_weave = -1;

Error: CPPCHECK_WARNING (CWE-476): [#def146]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1081: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1079|     result->autocut = -1;
# 1080|     result->microdot = -1;
# 1081|->   result->unidir = -1;
# 1082|     result->printer_weave = -1;
# 1083|   

Error: CPPCHECK_WARNING (CWE-476): [#def147]
ghostscript-10.05.1/devices/rinkj/rinkj-epson870.c:1082: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
# 1080|     result->microdot = -1;
# 1081|     result->unidir = -1;
# 1082|->   result->printer_weave = -1;
# 1083|   
# 1084|     return &result->super;

Error: CPPCHECK_WARNING (CWE-476): [#def148]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:178: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: out_data
#  176|     for (i = 0; i < n_planes; i++)
#  177|       {
#  178|->       out_data[i] = malloc (xsb);
#  179|         out_buf[i] = malloc (xs);
#  180|         data_permuted[i] = (const uchar *)data[permutation[i]];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:178:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘out_data’
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:148:6: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:148:6: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:172:24: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:176:15: branch_true: following ‘true’ branch (when ‘i < n_planes’)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:178:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:178:7: danger: ‘out_data + (long unsigned int)i * 8’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  176|     for (i = 0; i < n_planes; i++)
#  177|       {
#  178|->       out_data[i] = malloc (xsb);
#  179|         out_buf[i] = malloc (xs);
#  180|         data_permuted[i] = (const uchar *)data[permutation[i]];

Error: CPPCHECK_WARNING (CWE-476): [#def150]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:179: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: out_buf
#  177|       {
#  178|         out_data[i] = malloc (xsb);
#  179|->       out_buf[i] = malloc (xs);
#  180|         data_permuted[i] = (const uchar *)data[permutation[i]];
#  181|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def151]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:179:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘out_buf’
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:148:6: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:148:6: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:173:23: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:176:15: branch_true: following ‘true’ branch (when ‘i < n_planes’)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:178:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:179:7: danger: ‘out_buf + (long unsigned int)i * 8’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  177|       {
#  178|         out_data[i] = malloc (xsb);
#  179|->       out_buf[i] = malloc (xs);
#  180|         data_permuted[i] = (const uchar *)data[permutation[i]];
#  181|       }

Error: CPPCHECK_WARNING (CWE-476): [#def152]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:180: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data_permuted
#  178|         out_data[i] = malloc (xsb);
#  179|         out_buf[i] = malloc (xs);
#  180|->       data_permuted[i] = (const uchar *)data[permutation[i]];
#  181|       }
#  182|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def153]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:180:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data_permuted’
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:148:6: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:148:6: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:174:35: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:176:15: branch_true: following ‘true’ branch (when ‘i < n_planes’)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:178:21: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:180:7: danger: ‘data_permuted + (long unsigned int)i * 8’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  178|         out_data[i] = malloc (xsb);
#  179|         out_buf[i] = malloc (xs);
#  180|->       data_permuted[i] = (const uchar *)data[permutation[i]];
#  181|       }
#  182|   

Error: CPPCHECK_WARNING (CWE-476): [#def154]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:192: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: out_data
#  190|         for (i = 0; i < n_planes; i++)
#  191|           {
#  192|->           uchar *pd = out_data[permutation[i]];
#  193|             uchar *pb = out_buf[i];
#  194|             int x;

Error: CPPCHECK_WARNING (CWE-476): [#def155]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:193: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: out_buf
#  191|           {
#  192|             uchar *pd = out_data[permutation[i]];
#  193|->           uchar *pb = out_buf[i];
#  194|             int x;
#  195|   

Error: CPPCHECK_WARNING (CWE-476): [#def156]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:267: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  265|     result = (RinkjScreenEb *)malloc (sizeof(RinkjScreenEb));
#  266|   
#  267|->   result->super.set = rinkj_screen_eb_set;
#  268|     result->super.write = rinkj_screen_eb_write;
#  269|     result->super.init = rinkj_screen_eb_init;

Error: CPPCHECK_WARNING (CWE-476): [#def157]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:268: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  266|   
#  267|     result->super.set = rinkj_screen_eb_set;
#  268|->   result->super.write = rinkj_screen_eb_write;
#  269|     result->super.init = rinkj_screen_eb_init;
#  270|     result->super.init_happened = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def158]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:269: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  267|     result->super.set = rinkj_screen_eb_set;
#  268|     result->super.write = rinkj_screen_eb_write;
#  269|->   result->super.init = rinkj_screen_eb_init;
#  270|     result->super.init_happened = 0;
#  271|     result->dev_out = dev_out;

Error: CPPCHECK_WARNING (CWE-476): [#def159]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:270: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  268|     result->super.write = rinkj_screen_eb_write;
#  269|     result->super.init = rinkj_screen_eb_init;
#  270|->   result->super.init_happened = 0;
#  271|     result->dev_out = dev_out;
#  272|     result->lut = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def160]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:271: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  269|     result->super.init = rinkj_screen_eb_init;
#  270|     result->super.init_happened = 0;
#  271|->   result->dev_out = dev_out;
#  272|     result->lut = NULL;
#  273|     result->xscale = 1.0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def161]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:271:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:265:29: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:271:3: danger: ‘result’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  269|     result->super.init = rinkj_screen_eb_init;
#  270|     result->super.init_happened = 0;
#  271|->   result->dev_out = dev_out;
#  272|     result->lut = NULL;
#  273|     result->xscale = 1.0;

Error: CPPCHECK_WARNING (CWE-476): [#def162]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:272: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  270|     result->super.init_happened = 0;
#  271|     result->dev_out = dev_out;
#  272|->   result->lut = NULL;
#  273|     result->xscale = 1.0;
#  274|     result->yscale = 1.0;

Error: CPPCHECK_WARNING (CWE-476): [#def163]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:273: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  271|     result->dev_out = dev_out;
#  272|     result->lut = NULL;
#  273|->   result->xscale = 1.0;
#  274|     result->yscale = 1.0;
#  275|     result->aspect = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def164]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:274: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  272|     result->lut = NULL;
#  273|     result->xscale = 1.0;
#  274|->   result->yscale = 1.0;
#  275|     result->aspect = 1;
#  276|     result->bps = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def165]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:275: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  273|     result->xscale = 1.0;
#  274|     result->yscale = 1.0;
#  275|->   result->aspect = 1;
#  276|     result->bps = 1;
#  277|   

Error: CPPCHECK_WARNING (CWE-476): [#def166]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:276: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  274|     result->yscale = 1.0;
#  275|     result->aspect = 1;
#  276|->   result->bps = 1;
#  277|   
#  278|     return &result->super;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def167]
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:329:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown> + (long unsigned int)i * 4’
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:318:6: branch_false: following ‘false’ branch (when ‘plane <= 15’)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:321:7: branch_false: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:321:6: branch_true: following ‘true’ branch...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:322:22: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:324:26: acquire_memory: this call could return NULL
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:325:15: branch_true: following ‘true’ branch (when ‘i != 256’)...
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:328:20: branch_true: ...to here
ghostscript-10.05.1/devices/rinkj/rinkj-screen-eb.c:329:7: danger: ‘*<unknown> + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  327|         double v;
#  328|         v = 1.0 - lut[i];
#  329|->       z->lut[plane][i] = floor (0.5 + 0x1000000 * v);
#  330|       }
#  331|   }

Error: COMPILER_WARNING (CWE-563): [#def168]
ghostscript-10.05.1/devices/vector/gdevpdfg.c: scope_hint: In function ‘check_colorants_for_pdfx4’
ghostscript-10.05.1/devices/vector/gdevpdfg.c:1425:17: warning[-Wunused-variable]: unused variable ‘Colorant’
# 1425 |     char *ink, *Colorant;
#      |                 ^~~~~~~~
# 1423|   {
# 1424|       int comp, all_present = 1;
# 1425|->     char *ink, *Colorant;
# 1426|       gs_device_n_colorant *colorant = NULL;
# 1427|   

Error: COMPILER_WARNING (CWE-563): [#def169]
ghostscript-10.05.1/devices/vector/gdevpdfi.c: scope_hint: In function ‘check_colorants_for_pdfx4’
ghostscript-10.05.1/devices/vector/gdevpdfi.c:516:17: warning[-Wunused-variable]: unused variable ‘Colorant’
#  516 |     char *ink, *Colorant;
#      |                 ^~~~~~~~
#  514|   {
#  515|       int comp, all_present = 1;
#  516|->     char *ink, *Colorant;
#  517|       gs_device_n_colorant *colorant = NULL;
#  518|   

Error: COMPILER_WARNING (CWE-704): [#def170]
ghostscript-10.05.1/devices/vector/gdevpdfi.c: scope_hint: In function ‘setup_image_colorspace’
ghostscript-10.05.1/devices/vector/gdevpdfi.c:755:43: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  755 |                                 *pcs_orig = pcs;
#      |                                           ^
#  753|                           if (pdev->PDFX > 0) {
#  754|                               if (pdev->PDFX < 4) {
#  755|->                                 *pcs_orig = pcs;
#  756|                                   return 1;
#  757|                               }

Error: COMPILER_WARNING (CWE-704): [#def171]
ghostscript-10.05.1/devices/vector/gdevpdfi.c:755:43: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  753|                           if (pdev->PDFX > 0) {
#  754|                               if (pdev->PDFX < 4) {
#  755|->                                 *pcs_orig = pcs;
#  756|                                   return 1;
#  757|                               }

Error: COMPILER_WARNING (CWE-704): [#def172]
ghostscript-10.05.1/devices/vector/gdevpdfi.c:759:43: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  759 |                                 *pcs_orig = pcs;
#      |                                           ^
#  757|                               }
#  758|                               if (!check_colorants_for_pdfx4(pcs2)){
#  759|->                                 *pcs_orig = pcs;
#  760|                                   return 1;
#  761|                               }

Error: COMPILER_WARNING (CWE-704): [#def173]
ghostscript-10.05.1/devices/vector/gdevpdfi.c:759:43: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  757|                               }
#  758|                               if (!check_colorants_for_pdfx4(pcs2)){
#  759|->                                 *pcs_orig = pcs;
#  760|                                   return 1;
#  761|                               }

Error: CPPCHECK_WARNING (CWE-476): [#def174]
ghostscript-10.05.1/pdf/pdf_dict.c:303: error[ctunullpointer]: Null pointer dereference: Key
#  301|       int index = 0;
#  302|   
#  303|->     Test = (char *)gs_alloc_bytes(ctx->memory, Key->length + 1, "pdfi_dict_find_key");
#  304|       if (Test == NULL)
#  305|           return_error(gs_error_VMerror);

Error: COMPILER_WARNING: [#def175]
ghostscript-10.05.1/pdf/pdf_sec.c:402:9: warning[-Wstringop-overflow=]: ‘pdf_compute_hardened_hash_r6’ accessing 16 bytes in a region of size 8
#  402 |         pdf_compute_hardened_hash_r6(password, pwlen,
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  403 |         (ownerkey ? O : U) + 40,
#      |         ~~~~~~~~~~~~~~~~~~~~~~~~
#  404 |         (ownerkey ? U : NULL), hash);
#      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ghostscript-10.05.1/pdf/pdf_sec.c:402:9: note: referencing argument 3 of type ‘unsigned char[16]’
ghostscript-10.05.1/pdf/pdf_sec.c:402:9: note: referencing argument 5 of type ‘unsigned char[32]’
ghostscript-10.05.1/pdf/pdf_sec.c: scope_hint: In function ‘check_owner_password_R6.constprop.0’
ghostscript-10.05.1/pdf/pdf_sec.c:324:1: note: in a call to function ‘pdf_compute_hardened_hash_r6’
#  324 | pdf_compute_hardened_hash_r6(unsigned char *password, int pwlen, unsigned char salt[16], unsigned char *ownerkey, unsigned char hash[32])
#      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  400|   		(ownerkey ? O : U) + 32,
#  401|   		ownerkey ? U : NULL, validationkey);
#  402|-> 	pdf_compute_hardened_hash_r6(password, pwlen,
#  403|           (ownerkey ? O : U) + 40,
#  404|           (ownerkey ? U : NULL), hash);

Error: COMPILER_WARNING: [#def176]
ghostscript-10.05.1/pdf/pdf_sec.c:402:9: warning[-Wstringop-overflow=]: ‘pdf_compute_hardened_hash_r6’ accessing 16 bytes in a region of size 8
#  400|   		(ownerkey ? O : U) + 32,
#  401|   		ownerkey ? U : NULL, validationkey);
#  402|-> 	pdf_compute_hardened_hash_r6(password, pwlen,
#  403|           (ownerkey ? O : U) + 40,
#  404|           (ownerkey ? U : NULL), hash);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def177]
ghostscript-10.05.1/psi/dxmain.c:1208:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘nargv’
ghostscript-10.05.1/psi/dxmain.c:1207:22: acquire_memory: this call could return NULL
ghostscript-10.05.1/psi/dxmain.c:1208:5: danger: ‘nargv’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1206|       nargc = argc + 1;
# 1207|       nargv = (char **)malloc(nargc * sizeof(char *));
# 1208|->     nargv[0] = argv[0];
# 1209|       nargv[1] = dformat;
# 1210|       memcpy(&nargv[2], &argv[1], (argc-1) * sizeof(char *));

Error: COMPILER_WARNING (CWE-563): [#def178]
ghostscript-10.05.1/psi/zcolor.c:170:17: warning[-Wunused-variable]: unused variable ‘stref’
#  170 |     ref namestr,stref, *aref;
#      |                 ^~~~~
#  168|       os_ptr  op = osp;   /* required by "push" macro */
#  169|       int code;
#  170|->     ref namestr,stref, *aref;
#  171|       byte *body;
#  172|   

Error: COMPILER_WARNING (CWE-563): [#def179]
ghostscript-10.05.1/psi/zcolor.c: scope_hint: In function ‘zcurrentcolorspace’
ghostscript-10.05.1/psi/zcolor.c:171:11: warning[-Wunused-variable]: unused variable ‘body’
#  171 |     byte *body;
#      |           ^~~~
#  169|       int code;
#  170|       ref namestr,stref, *aref;
#  171|->     byte *body;
#  172|   
#  173|       /* Adobe applications expect that the Device spaces (DeviceGray

Error: COMPILER_WARNING (CWE-563): [#def180]
ghostscript-10.05.1/psi/zcolor.c: scope_hint: In function ‘copy_cspace_dict’
ghostscript-10.05.1/psi/zcolor.c:493:26: warning[-Wunused-variable]: unused variable ‘i’
#  493 |     int code = 0, index, i = 0;
#      |                          ^
#  491|   static int copy_cspace_dict(i_ctx_t * i_ctx_p, ref *dest, ref *src)
#  492|   {
#  493|->     int code = 0, index, i = 0;
#  494|       uint saved_space = avm_local;
#  495|       ref eltp[2], cref;

Error: COMPILER_WARNING (CWE-563): [#def181]
ghostscript-10.05.1/psi/zcolor.c: scope_hint: In function ‘septransform’
ghostscript-10.05.1/psi/zcolor.c:3944:30: warning[-Wunused-variable]: unused variable ‘pimap’
# 3944 |             gs_device_n_map *pimap;
#      |                              ^~~~~
# 3942|           if (*stage == 10) {
# 3943|               gs_function_t *pfn = NULL;
# 3944|->             gs_device_n_map *pimap;
# 3945|               gs_color_space * pcs;
# 3946|               float in, out[4];

Error: COMPILER_WARNING (CWE-563): [#def182]
ghostscript-10.05.1/psi/zcolor.c: scope_hint: In function ‘devicentransform’
ghostscript-10.05.1/psi/zcolor.c:4802:30: warning[-Wunused-variable]: unused variable ‘pimap’
# 4802 |             gs_device_n_map *pimap;
#      |                              ^~~~~
# 4800|           if (*stage == 10) {
# 4801|               gs_function_t *pfn = NULL;
# 4802|->             gs_device_n_map *pimap;
# 4803|               gs_color_space * pcs;
# 4804|               float *in, *out;

Error: COMPILER_WARNING (CWE-563): [#def183]
ghostscript-10.05.1/psi/zcolor.c: scope_hint: In function ‘currentbasecolor’
ghostscript-10.05.1/psi/zcolor.c:7289:12: warning[-Wunused-variable]: unused variable ‘ep’
# 7289 |     es_ptr ep = esp;
#      |            ^~
# 7287|   {
# 7288|       ref *parr = &arr;
# 7289|->     es_ptr ep = esp;
# 7290|       int i, code = 0, cont=1, CIESubst=0;
# 7291|       unsigned int depth = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def184]
ghostscript-10.05.1/psi/zicc.c:229:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘picc_profile’
ghostscript-10.05.1/psi/zicc.c:77:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:79:5: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:79:5: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:79:5: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:83:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:94:9: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:109:12: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:116:62: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:118:9: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:125:71: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:126:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:131:5: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:153:8: branch_false: following ‘false’ branch...
ghostscript-10.05.1/psi/zicc.c:161:5: branch_false: ...to here
ghostscript-10.05.1/psi/zicc.c:222:8: branch_true: following ‘true’ branch (when ‘picc_profile’ is non-NULL)...
ghostscript-10.05.1/psi/zicc.c:226:9: branch_true: ...to here
ghostscript-10.05.1/psi/zicc.c:226:9: branch_true: following ‘true’ branch...
ghostscript-10.05.1/psi/zicc.c:226:9: branch_true: ...to here
ghostscript-10.05.1/psi/zicc.c:227:12: branch_true: following ‘true’ branch...
ghostscript-10.05.1/psi/zicc.c:229:36: branch_true: ...to here
ghostscript-10.05.1/psi/zicc.c:229:36: danger: dereference of NULL ‘picc_profile’
#  227|           if (code >= 0) {
#  228|               /* Save this colorspace in the iccprofile_cache */
#  229|->             gsicc_add_cs(igs, pcs, picc_profile->hashcode);
#  230|               /* should be an integer, but if for some reason it isn't, don't update */
#  231|               if (phashval && r_has_type(phashval, t_integer))

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
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-177.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.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameghostscript-10.06.0-1.fc44
diffbase-store-results-to/tmp/tmp11q9unix/ghostscript-10.06.0-1.fc44.tar.xz
diffbase-time-created2026-01-08 16:23:56
diffbase-time-finished2026-01-08 16:30:44
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp11q9unix/ghostscript-10.06.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp11q9unix/ghostscript-10.06.0-1.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-177.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameghostscript-10.05.1-5.fc43
store-results-to/tmp/tmped31b30n/ghostscript-10.05.1-5.fc43.tar.xz
time-created2026-01-08 16:16:24
time-finished2026-01-08 16:23:15
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmped31b30n/ghostscript-10.05.1-5.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmped31b30n/ghostscript-10.05.1-5.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9