libcdio-2.3.0-2.fc45

List of Findings

Error: CPPCHECK_WARNING (CWE-476): [#def1]
libcdio-2.3.0/example/udf1.c:85: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: psz_newpath
#   83|   	char *psz_newpath = calloc(1, sizeof(char)*i_newlen);
#   84|   
#   85|-> 	snprintf(psz_newpath, i_newlen, "%s%s/", psz_path, psz_dirname);
#   86|   	list_files(p_udf, p_udf_dirent2, psz_newpath);
#   87|   	free(psz_newpath);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libcdio-2.3.0/example/udffile.c:128:52: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(psz_local_fname, "wb")’
libcdio-2.3.0/example/udffile.c:92:6: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:97:32: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:99:8: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:107:18: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:108:8: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:118:21: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:118:21: acquire_resource: opened here
libcdio-2.3.0/example/udffile.c:118:8: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:127:32: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:130:19: branch_true: following ‘true’ branch (when ‘i < i_blocks’)...
libcdio-2.3.0/example/udffile.c:131:14: branch_true: ...to here
libcdio-2.3.0/example/udffile.c:128:52: danger: ‘fopen(psz_local_fname, "wb")’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  126|       {
#  127|         uint64_t i_file_length = udf_get_file_length(p_udf_file);
#  128|->       const unsigned int i_blocks = (unsigned int) CEILING(i_file_length, UDF_BLOCKSIZE);
#  129|         unsigned int i;
#  130|         for (i = 0; i < i_blocks ; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libcdio-2.3.0/example/udffile.c:128:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(psz_local_fname, "wb")’
libcdio-2.3.0/example/udffile.c:92:6: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:97:32: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:99:8: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:107:18: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:108:8: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:118:21: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:118:21: acquire_memory: allocated here
libcdio-2.3.0/example/udffile.c:118:8: branch_false: following ‘false’ branch...
libcdio-2.3.0/example/udffile.c:127:32: branch_false: ...to here
libcdio-2.3.0/example/udffile.c:130:19: branch_true: following ‘true’ branch (when ‘i < i_blocks’)...
libcdio-2.3.0/example/udffile.c:131:14: branch_true: ...to here
libcdio-2.3.0/example/udffile.c:128:52: danger: ‘fopen(psz_local_fname, "wb")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  126|       {
#  127|         uint64_t i_file_length = udf_get_file_length(p_udf_file);
#  128|->       const unsigned int i_blocks = (unsigned int) CEILING(i_file_length, UDF_BLOCKSIZE);
#  129|         unsigned int i;
#  130|         for (i = 0; i < i_blocks ; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def4]
libcdio-2.3.0/lib/driver/_cdio_stdio.c:278: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ud
#  276|     cdio_assert (ud != NULL);
#  277|   
#  278|->   ud->pathname = pathdup;
#  279|     ud->st_size  = statbuf.st_size; /* let's hope it doesn't change... */
#  280|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
libcdio-2.3.0/lib/driver/_cdio_stdio.c:278:3: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ud'
libcdio-2.3.0/lib/driver/_cdio_stdio.c:259:6: branch_false: following 'false' branch (when 'pathname' is non-NULL)...
libcdio-2.3.0/lib/driver/_cdio_stdio.c:263:13: branch_false: ...to here
libcdio-2.3.0/lib/driver/_cdio_stdio.c:264:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/_cdio_stdio.c:267:7: branch_false: ...to here
libcdio-2.3.0/lib/driver/_cdio_stdio.c:267:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/_cdio_stdio.c:275:8: branch_false: ...to here
libcdio-2.3.0/lib/driver/_cdio_stdio.c:275:8: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/_cdio_stdio.c:276:3: release_memory: assuming 'ud' is NULL
libcdio-2.3.0/lib/driver/_cdio_stdio.c:276:3: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/_cdio_stdio.c:276:3: branch_true: ...to here
libcdio-2.3.0/lib/driver/_cdio_stdio.c:278:3: danger: dereference of NULL 'ud'
#  276|     cdio_assert (ud != NULL);
#  277|   
#  278|->   ud->pathname = pathdup;
#  279|     ud->st_size  = statbuf.st_size; /* let's hope it doesn't change... */
#  280|   

Error: CPPCHECK_WARNING (CWE-476): [#def6]
libcdio-2.3.0/lib/driver/_cdio_stdio.c:279: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ud
#  277|   
#  278|     ud->pathname = pathdup;
#  279|->   ud->st_size  = statbuf.st_size; /* let's hope it doesn't change... */
#  280|   
#  281|     funcs.open   = _stdio_open;

Error: CPPCHECK_WARNING (CWE-476): [#def7]
libcdio-2.3.0/lib/driver/_cdio_stream.c:104: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_obj
#  102|     cdio_assert (new_obj != NULL);
#  103|   
#  104|->   new_obj->user_data = user_data;
#  105|     memcpy(&(new_obj->op), funcs, sizeof(cdio_stream_io_functions));
#  106|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
libcdio-2.3.0/lib/driver/_cdio_stream.c:104:3: warning[-Wanalyzer-null-dereference]: dereference of NULL 'new_obj'
libcdio-2.3.0/lib/driver/_cdio_stream.c:101:13: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/_cdio_stream.c:102:3: release_memory: assuming 'new_obj' is NULL
libcdio-2.3.0/lib/driver/_cdio_stream.c:102:3: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/_cdio_stream.c:102:3: branch_true: ...to here
libcdio-2.3.0/lib/driver/_cdio_stream.c:104:3: danger: dereference of NULL 'new_obj'
#  102|     cdio_assert (new_obj != NULL);
#  103|   
#  104|->   new_obj->user_data = user_data;
#  105|     memcpy(&(new_obj->op), funcs, sizeof(cdio_stream_io_functions));
#  106|   

Error: CPPCHECK_WARNING (CWE-476): [#def9]
libcdio-2.3.0/lib/driver/abs_path.c:101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#   99|         size_t len   = strlen(cwd) + strlen(fname) + 2;
#  100|         char* result = calloc(sizeof(char), len);
#  101|->       snprintf(result, len, "%s%c%s",
#  102|   	       cwd, CDIO_FILE_SEPARATOR, fname);
#  103|         return result;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def10]
libcdio-2.3.0/lib/driver/cdtext.c:809:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'blocksize.i_first_track'
libcdio-2.3.0/lib/driver/cdtext.c:621:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/cdtext.c:634:9: branch_true: following 'true' branch (when 'i_data != 0')...
libcdio-2.3.0/lib/driver/cdtext.c:636:5: branch_true: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:638:8: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/cdtext.c:787:16: branch_true: following 'true' branch (when 'j <= 11')...
libcdio-2.3.0/lib/driver/cdtext.c:790:16: branch_true: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:790:14: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/cdtext.c:796:14: branch_false: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:796:14: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/cdtext.c:802:15: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/cdtext.c:803:43: branch_true: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:860:14: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/cdtext.c:861:13: branch_true: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:787:16: branch_true: following 'true' branch (when 'j <= 11')...
libcdio-2.3.0/lib/driver/cdtext.c:790:16: branch_true: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:790:14: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/cdtext.c:796:14: branch_false: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:796:14: branch_false: following 'false' branch (when 'i_buf != 0')...
libcdio-2.3.0/lib/driver/cdtext.c:800:18: branch_false: ...to here
libcdio-2.3.0/lib/driver/cdtext.c:800:14: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/cdtext.c:808:16: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/cdtext.c:809:33: danger: use of uninitialized value 'blocksize.i_first_track' here
#  807|               /* check if the buffer contains only the Tab Indicator */
#  808|               if ( CDTEXT_COMPARE_CHAR(buffer, '\t', pack.db_chars) ) {
#  809|->               if ( cur_track <= blocksize.i_first_track ) {
#  810|                   cdio_warn("CD-TEXT: Invalid use of Tab Indicator.");
#  811|                   return -1;

Error: CPPCHECK_WARNING (CWE-476): [#def11]
libcdio-2.3.0/lib/driver/ds.c:90: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_new_node
#   88|     cdio_assert (p_new_node != NULL);
#   89|   
#   90|->   p_new_node->list = p_list;
#   91|     p_new_node->next = p_list->begin;
#   92|     p_new_node->data = p_data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
libcdio-2.3.0/lib/driver/ds.c:90:3: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p_new_node'
libcdio-2.3.0/lib/driver/ds.c:87:16: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/ds.c:88:3: release_memory: assuming 'p_new_node' is NULL
libcdio-2.3.0/lib/driver/ds.c:88:3: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/ds.c:88:3: branch_true: ...to here
libcdio-2.3.0/lib/driver/ds.c:90:3: danger: dereference of NULL 'p_new_node'
#   88|     cdio_assert (p_new_node != NULL);
#   89|   
#   90|->   p_new_node->list = p_list;
#   91|     p_new_node->next = p_list->begin;
#   92|     p_new_node->data = p_data;

Error: CPPCHECK_WARNING (CWE-476): [#def13]
libcdio-2.3.0/lib/driver/ds.c:91: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_new_node
#   89|   
#   90|     p_new_node->list = p_list;
#   91|->   p_new_node->next = p_list->begin;
#   92|     p_new_node->data = p_data;
#   93|   

Error: CPPCHECK_WARNING (CWE-476): [#def14]
libcdio-2.3.0/lib/driver/ds.c:92: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_new_node
#   90|     p_new_node->list = p_list;
#   91|     p_new_node->next = p_list->begin;
#   92|->   p_new_node->data = p_data;
#   93|   
#   94|     p_list->begin = p_new_node;

Error: CPPCHECK_WARNING (CWE-476): [#def15]
libcdio-2.3.0/lib/driver/ds.c:115: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_new_node
#  113|         cdio_assert (p_new_node != NULL);
#  114|   
#  115|->       p_new_node->list = p_list;
#  116|         p_new_node->next = NULL;
#  117|         p_new_node->data = p_data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
libcdio-2.3.0/lib/driver/ds.c:115:7: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p_new_node'
libcdio-2.3.0/lib/driver/ds.c:106:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/ds.c:112:36: branch_false: ...to here
libcdio-2.3.0/lib/driver/ds.c:112:36: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/ds.c:113:7: release_memory: assuming 'p_new_node' is NULL
libcdio-2.3.0/lib/driver/ds.c:113:7: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/ds.c:113:7: branch_true: ...to here
libcdio-2.3.0/lib/driver/ds.c:115:7: danger: dereference of NULL 'p_new_node'
#  113|         cdio_assert (p_new_node != NULL);
#  114|   
#  115|->       p_new_node->list = p_list;
#  116|         p_new_node->next = NULL;
#  117|         p_new_node->data = p_data;

Error: CPPCHECK_WARNING (CWE-476): [#def17]
libcdio-2.3.0/lib/driver/ds.c:116: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_new_node
#  114|   
#  115|         p_new_node->list = p_list;
#  116|->       p_new_node->next = NULL;
#  117|         p_new_node->data = p_data;
#  118|   

Error: CPPCHECK_WARNING (CWE-476): [#def18]
libcdio-2.3.0/lib/driver/ds.c:117: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_new_node
#  115|         p_new_node->list = p_list;
#  116|         p_new_node->next = NULL;
#  117|->       p_new_node->data = p_data;
#  118|   
#  119|         p_list->end->next = p_new_node;

Error: COMPILER_WARNING (CWE-1164): [#def19]
libcdio-2.3.0/lib/driver/gnu_linux.c:561:1: warning[-Wunused-function]: 'get_mcn_linux' defined but not used
#  561 | get_mcn_linux (const void *p_user_data) {
#      | ^~~~~~~~~~~~~
#  559|    */
#  560|   static char *
#  561|-> get_mcn_linux (const void *p_user_data) {
#  562|   
#  563|     struct cdrom_mcn mcn;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def20]
libcdio-2.3.0/lib/driver/gnu_linux.c:1753:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '_data'
libcdio-2.3.0/lib/driver/gnu_linux.c:1751:27: acquire_memory: this call could return NULL
libcdio-2.3.0/lib/driver/gnu_linux.c:1753:3: danger: '_data' could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1751|     _data                 = calloc (1, sizeof (_img_private_t));
# 1752|   
# 1753|->   _data->access_mode    = str_to_access_mode_linux(access_mode);
# 1754|     _data->gen.init       = false;
# 1755|     _data->gen.toc_init   = false;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
libcdio-2.3.0/lib/driver/gnu_linux.c:1760:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'calloc(1, 8)'
libcdio-2.3.0/lib/driver/gnu_linux.c:1759:35: acquire_memory: this call could return NULL
libcdio-2.3.0/lib/driver/gnu_linux.c:1760:3: danger: 'calloc(1, 8)' could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1758|   #ifdef __CDIO_LINUXCD_USE_TIMED_MEDIA_CHANGED
# 1759|     _data->last_changed_timestamp = calloc(1, sizeof (__s64));
# 1760|->   *(_data->last_changed_timestamp) = 0;
# 1761|   #endif
# 1762|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
libcdio-2.3.0/lib/driver/image/bincue.c:473:15: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(_cdio_strdup_fixpath(psz_cue_name), "r")'
libcdio-2.3.0/lib/driver/image/bincue.c:1297:1: enter_function: entry to 'cdio_open_bincue'
libcdio-2.3.0/lib/driver/image/bincue.c:1299:24: call_function: calling 'cdio_is_cuefile' from 'cdio_open_bincue'
#  471|               goto err_exit;
#  472|             }
#  473|->           if (i_track < 1 || i_track > 99) {
#  474|               cdio_log(log_level,
#  475|                        "Track number out of range 1 to %d, got %s.", CDIO_CD_MAX_TRACKS, psz_field);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libcdio-2.3.0/lib/driver/image/bincue.c:473:15: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(_cdio_strdup_fixpath(psz_cue_name), "r")'
libcdio-2.3.0/lib/driver/image/bincue.c:1297:1: enter_function: entry to 'cdio_open_bincue'
libcdio-2.3.0/lib/driver/image/bincue.c:1299:24: call_function: calling 'cdio_is_cuefile' from 'cdio_open_bincue'
#  471|               goto err_exit;
#  472|             }
#  473|->           if (i_track < 1 || i_track > 99) {
#  474|               cdio_log(log_level,
#  475|                        "Track number out of range 1 to %d, got %s.", CDIO_CD_MAX_TRACKS, psz_field);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def24]
libcdio-2.3.0/lib/driver/image/bincue.c:1224:16: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'psz_cue_name' where non-null expected
libcdio-2.3.0/lib/driver/image/bincue.c:1297:1: enter_function: entry to 'cdio_open_bincue'
libcdio-2.3.0/lib/driver/image/bincue.c:1305:26: call_function: calling 'cdio_is_binfile' from 'cdio_open_bincue'
libcdio-2.3.0/lib/driver/image/bincue.c:1305:26: return_function: returning to 'cdio_open_bincue' from 'cdio_is_binfile'
libcdio-2.3.0/lib/driver/image/bincue.c:1306:20: call_function: calling 'cdio_open_cue' from 'cdio_open_bincue'
# 1222|      */
# 1223|   
# 1224|->   psz_bin_name=strdup(psz_cue_name);
# 1225|     i=strlen(psz_bin_name)-strlen("cue");
# 1226|   

Error: CPPCHECK_WARNING (CWE-476): [#def25]
libcdio-2.3.0/lib/driver/image/bincue.c:1225: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: psz_bin_name
# 1223|   
# 1224|     psz_bin_name=strdup(psz_cue_name);
# 1225|->   i=strlen(psz_bin_name)-strlen("cue");
# 1226|   
# 1227|     if (i>0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def26]
libcdio-2.3.0/lib/driver/image/bincue.c:1225:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'psz_bin_name' where non-null expected
libcdio-2.3.0/lib/driver/image/bincue.c:1297:1: enter_function: entry to 'cdio_open_bincue'
libcdio-2.3.0/lib/driver/image/bincue.c:1299:24: call_function: calling 'cdio_is_cuefile' from 'cdio_open_bincue'
# 1223|   
# 1224|     psz_bin_name=strdup(psz_cue_name);
# 1225|->   i=strlen(psz_bin_name)-strlen("cue");
# 1226|   
# 1227|     if (i>0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
libcdio-2.3.0/lib/driver/image/nrg.c:501:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'calloc(1, 13)' where non-null expected
libcdio-2.3.0/lib/driver/image/nrg.c:192:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/image/nrg.c:198:47: branch_false: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:227:12: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/image/nrg.c:228:34: branch_true: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:389:14: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/image/nrg.c:391:34: branch_false: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:394:14: branch_true: following 'true' branch (when 'opcode == 1145130840')...
libcdio-2.3.0/lib/driver/image/nrg.c:395:13: branch_true: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:403:11: branch_true: following 'true' branch (when 'opcode == 1145130840')...
libcdio-2.3.0/lib/driver/image/nrg.c:403:11: branch_true: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:440:14: branch_false: following 'false' branch (when 'disc_mode != 0')...
libcdio-2.3.0/lib/driver/image/nrg.c:461:21: branch_false: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:461:21: branch_false: following 'false' branch (when 'disc_mode != 2')...
libcdio-2.3.0/lib/driver/image/nrg.c:484:21: branch_false: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:484:21: branch_true: following 'true' branch (when 'disc_mode == 32')...
libcdio-2.3.0/lib/driver/image/nrg.c:485:13: branch_true: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:493:21: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/image/nrg.c:495:16: branch_true: ...to here
libcdio-2.3.0/lib/driver/image/nrg.c:500:37: acquire_memory: this call could return NULL
libcdio-2.3.0/lib/driver/image/nrg.c:501:13: danger: argument 1 ('calloc(1, 13)') from [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18) could be NULL where non-null expected
#  499|   	    }
#  500|   	    p_env->tocent[i].isrc = calloc(1, CDIO_ISRC_SIZE+1);
#  501|-> 	    memcpy(p_env->tocent[i].isrc, _dao_array_common->psz_isrc, CDIO_ISRC_SIZE);
#  502|   	    p_env->tocent[i].isrc[CDIO_ISRC_SIZE] = '\0';
#  503|   	    if (p_env->tocent[i].isrc[0]) {

Error: CPPCHECK_WARNING (CWE-476): [#def28]
libcdio-2.3.0/lib/driver/utf8.c:131: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  129|     cdio_charset_coverter_t * ret;
#  130|     ret = calloc(1, sizeof(*ret));
#  131|->   ret->ic = iconv_open(dst_charset, src_charset);
#  132|     return ret;
#  133|     }

Error: CPPCHECK_WARNING (CWE-476): [#def29]
libcdio-2.3.0/lib/driver/util.c:91: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
#   89|     n = 1;
#   90|     p = _str;
#   91|->   while(*p)
#   92|       if (*(p++) == delim)
#   93|         n++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
libcdio-2.3.0/lib/driver/util.c:91:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
libcdio-2.3.0/lib/driver/util.c:84:10: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/util.c:87:3: release_memory: assuming '_str' is NULL
libcdio-2.3.0/lib/driver/util.c:87:3: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/util.c:87:3: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:91:9: danger: dereference of NULL 'p'
#   89|     n = 1;
#   90|     p = _str;
#   91|->   while(*p)
#   92|       if (*(p++) == delim)
#   93|         n++;

Error: CPPCHECK_WARNING (CWE-682): [#def31]
libcdio-2.3.0/lib/driver/util.c:92: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#   90|     p = _str;
#   91|     while(*p)
#   92|->     if (*(p++) == delim)
#   93|         n++;
#   94|   

Error: CPPCHECK_WARNING (CWE-476): [#def32]
libcdio-2.3.0/lib/driver/util.c:92: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p++
#   90|     p = _str;
#   91|     while(*p)
#   92|->     if (*(p++) == delim)
#   93|         n++;
#   94|   

Error: CPPCHECK_WARNING (CWE-476): [#def33]
libcdio-2.3.0/lib/driver/util.c:100: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: strv
#   98|     n = 0;
#   99|     while((p = strtok(n ? NULL : _str, _delim)) != NULL)
#  100|->     strv[n++] = strdup(p);
#  101|   
#  102|     free(_str);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
libcdio-2.3.0/lib/driver/util.c:100:5: warning[-Wanalyzer-null-dereference]: dereference of NULL 'strv'
libcdio-2.3.0/lib/driver/util.c:87:3: branch_false: following 'false' branch...
libcdio-2.3.0/lib/driver/util.c:91:8: branch_false: ...to here
libcdio-2.3.0/lib/driver/util.c:95:10: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/util.c:96:3: release_memory: assuming 'strv' is NULL
libcdio-2.3.0/lib/driver/util.c:96:3: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/util.c:96:3: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:99:14: branch_true: following 'true' branch (when 'n == 0')...
libcdio-2.3.0/lib/driver/util.c:99:14: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:99:9: branch_true: following 'true' branch (when 'p' is non-NULL)...
libcdio-2.3.0/lib/driver/util.c:100:10: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:100:5: danger: dereference of NULL 'strv + (long unsigned int)n * 8'
#   98|     n = 0;
#   99|     while((p = strtok(n ? NULL : _str, _delim)) != NULL)
#  100|->     strv[n++] = strdup(p);
#  101|   
#  102|     free(_str);

Error: CPPCHECK_WARNING (CWE-476): [#def35]
libcdio-2.3.0/lib/driver/util.c:116: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_mem
#  114|         new_mem = calloc (1, count);
#  115|         cdio_assert (new_mem != NULL);
#  116|->       memcpy (new_mem, mem, count);
#  117|       }
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def36]
libcdio-2.3.0/lib/driver/util.c:116:7: warning[-Wanalyzer-null-argument]: use of NULL 'new_mem' where non-null expected
libcdio-2.3.0/lib/driver/util.c:112:6: branch_true: following 'true' branch (when 'mem' is non-NULL)...
libcdio-2.3.0/lib/driver/util.c:114:17: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:114:17: acquire_memory: allocated here
libcdio-2.3.0/lib/driver/util.c:115:7: release_memory: assuming 'new_mem' is NULL
libcdio-2.3.0/lib/driver/util.c:115:7: branch_true: following 'true' branch...
libcdio-2.3.0/lib/driver/util.c:115:7: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:116:7: danger: argument 1 ('new_mem') NULL where non-null expected
#  114|         new_mem = calloc (1, count);
#  115|         cdio_assert (new_mem != NULL);
#  116|->       memcpy (new_mem, mem, count);
#  117|       }
#  118|   

Error: CPPCHECK_WARNING (CWE-476): [#def37]
libcdio-2.3.0/lib/driver/util.c:133: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
#  131|         p = new_str = strdup (str);
#  132|   
#  133|->       while (*p)
#  134|           {
#  135|             *p = toupper ((unsigned char) *p);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
libcdio-2.3.0/lib/driver/util.c:133:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'p'
libcdio-2.3.0/lib/driver/util.c:127:6: branch_true: following 'true' branch (when 'str' is non-NULL)...
libcdio-2.3.0/lib/driver/util.c:131:21: branch_true: ...to here
libcdio-2.3.0/lib/driver/util.c:131:21: acquire_memory: this call could return NULL
libcdio-2.3.0/lib/driver/util.c:133:14: danger: 'p' could be NULL: unchecked value from [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  131|         p = new_str = strdup (str);
#  132|   
#  133|->       while (*p)
#  134|           {
#  135|             *p = toupper ((unsigned char) *p);

Error: CPPCHECK_WARNING (CWE-476): [#def39]
libcdio-2.3.0/lib/driver/util.c:135: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
#  133|         while (*p)
#  134|           {
#  135|->           *p = toupper ((unsigned char) *p);
#  136|             p++;
#  137|           }

Error: CPPCHECK_WARNING (CWE-682): [#def40]
libcdio-2.3.0/lib/driver/util.c:136: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  134|           {
#  135|             *p = toupper ((unsigned char) *p);
#  136|->           p++;
#  137|           }
#  138|       }

Error: CPPCHECK_WARNING (CWE-476): [#def41]
libcdio-2.3.0/lib/iso9660/iso9660.c:1016: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
# 1014|     cdio_assert (pathname != NULL);
# 1015|   
# 1016|->   if (*p == '/' || *p == '.' || *p == '\0')
# 1017|       return false;
# 1018|   

Error: CPPCHECK_WARNING (CWE-476): [#def42]
libcdio-2.3.0/lib/iso9660/iso9660.c:1019: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pathname
# 1017|       return false;
# 1018|   
# 1019|->   if (strlen (pathname) > MAX_ISOPATHNAME)
# 1020|       return false;
# 1021|   

Error: CPPCHECK_WARNING (CWE-476): [#def43]
libcdio-2.3.0/lib/iso9660/iso9660.c:1068: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: _tmp
# 1066|         char *_tmp = strdup (pathname);
# 1067|   
# 1068|->       *strrchr (_tmp, '/') = '\0';
# 1069|   
# 1070|         rc = iso9660_dirname_valid_p (_tmp);

Error: CPPCHECK_WARNING (CWE-476): [#def44]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1143: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1141|         p_stat = calloc(1, len);
# 1142|         cdio_assert (p_stat != NULL);
# 1143|->       memcpy(p_stat, _root, len);
# 1144|         p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1145|         cdio_assert (p_stat->rr.psz_symlink != NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def45]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1142|         cdio_assert (p_stat != NULL);
# 1143|         memcpy(p_stat, _root, len);
# 1144|->       p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1145|         cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1146|         memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,

Error: CPPCHECK_WARNING (CWE-476): [#def46]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1145: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1143|         memcpy(p_stat, _root, len);
# 1144|         p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1145|->       cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1146|         memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,
# 1147|   	     p_stat->rr.i_symlink_max);

Error: CPPCHECK_WARNING (CWE-476): [#def47]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1146: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1144|         p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1145|         cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1146|->       memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,
# 1147|   	     p_stat->rr.i_symlink_max);
# 1148|         return p_stat;

Error: CPPCHECK_WARNING (CWE-476): [#def48]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1147: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1145|         cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1146|         memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,
# 1147|-> 	     p_stat->rr.i_symlink_max);
# 1148|         return p_stat;
# 1149|       }

Error: CPPCHECK_WARNING (CWE-476): [#def49]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1253: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1251|         p_stat = calloc(1, len);
# 1252|         cdio_assert (p_stat != NULL);
# 1253|->       memcpy(p_stat, _root, len);
# 1254|         p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1255|         cdio_assert (p_stat->rr.psz_symlink != NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def50]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1254: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1252|         cdio_assert (p_stat != NULL);
# 1253|         memcpy(p_stat, _root, len);
# 1254|->       p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1255|         cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1256|         memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,

Error: CPPCHECK_WARNING (CWE-476): [#def51]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1255: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1253|         memcpy(p_stat, _root, len);
# 1254|         p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1255|->       cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1256|         memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,
# 1257|   	     p_stat->rr.i_symlink_max);

Error: CPPCHECK_WARNING (CWE-476): [#def52]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1256: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1254|         p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);
# 1255|         cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1256|->       memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,
# 1257|   	     p_stat->rr.i_symlink_max);
# 1258|         return p_stat;

Error: CPPCHECK_WARNING (CWE-476): [#def53]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1257: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p_stat
# 1255|         cdio_assert (p_stat->rr.psz_symlink != NULL);
# 1256|         memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,
# 1257|-> 	     p_stat->rr.i_symlink_max);
# 1258|         return p_stat;
# 1259|       }

Error: GCC_ANALYZER_WARNING (CWE-126): [#def54]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1994:8: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2070:1: enter_function: entry to 'iso9660_have_rr'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2076:6: branch_false: following 'false' branch (when 'p_iso' is non-NULL)...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2078:12: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2078:12: call_function: calling '_ifs_stat_root' from 'iso9660_have_rr'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2078:12: return_function: returning to 'iso9660_have_rr' from '_ifs_stat_root'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2079:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2081:7: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2083:11: call_function: calling 'iso_have_rr_traverse' from 'iso9660_have_rr'
# 1992|     bool_3way_t have_rr = nope;
# 1993|   
# 1994|->   if (!splitpath[0]) return false;
# 1995|   
# 1996|     if (_root->type == _STAT_FILE) return nope;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1996:7: warning[-Wanalyzer-null-dereference]: dereference of NULL '_root'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1985:1: enter_function: entry to 'iso_have_rr_traverse'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1994:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1996:7: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1996:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1997:7: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1997:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:1999:3: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2003:6: branch_false: following 'false' branch (when '_dirbuf' is non-NULL)...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2003:6: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2009:9: call_function: calling 'iso9660_iso_seek_read' from 'iso_have_rr_traverse'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2009:9: return_function: returning to 'iso_have_rr_traverse' from 'iso9660_iso_seek_read'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2010:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2010:6: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2015:10: branch_true: following 'true' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2017:47: branch_true: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2024:16: call_function: calling '_iso9660_dir_to_statbuf' from 'iso_have_rr_traverse'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2024:16: return_function: returning to 'iso_have_rr_traverse' from '_iso9660_dir_to_statbuf'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2027:10: branch_true: following 'true' branch (when 'have_rr != 1')...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2028:20: branch_true: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2028:12: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2031:21: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2031:21: call_function: calling 'iso_have_rr_traverse' from 'iso_have_rr_traverse'
# 1994|     if (!splitpath[0]) return false;
# 1995|   
# 1996|->   if (_root->type == _STAT_FILE) return nope;
# 1997|     if (*pu_file_limit == 0) return dunno;
# 1998|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def56]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2028:20: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2070:1: enter_function: entry to 'iso9660_have_rr'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2076:6: branch_false: following 'false' branch (when 'p_iso' is non-NULL)...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2078:12: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2078:12: call_function: calling '_ifs_stat_root' from 'iso9660_have_rr'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2078:12: return_function: returning to 'iso9660_have_rr' from '_ifs_stat_root'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2079:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2081:7: branch_false: ...to here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2083:11: call_function: calling 'iso_have_rr_traverse' from 'iso9660_have_rr'
# 2026|         have_rr = p_stat->rr.b3_rock;
# 2027|         if ( have_rr != yep) {
# 2028|-> 	if (strlen(splitpath[0]) == 0)
# 2029|   	  have_rr = false;
# 2030|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2076:22: warning[-Wanalyzer-malloc-leak]: leak of 'p_psz_splitpath[0]'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2073:31: acquire_memory: allocated here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2076:22: danger: 'p_psz_splitpath[0]' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 2074|     bool_3way_t is_rr = nope;
# 2075|   
# 2076|->   if (!p_iso) return false;
# 2077|   
# 2078|     p_root = _ifs_stat_root (p_iso);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2076:22: warning[-Wanalyzer-malloc-leak]: leak of 'p_psz_splitpath[1]'
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2073:44: acquire_memory: allocated here
libcdio-2.3.0/lib/iso9660/iso9660_fs.c:2076:22: danger: 'p_psz_splitpath[1]' leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 2074|     bool_3way_t is_rr = nope;
# 2075|   
# 2076|->   if (!p_iso) return false;
# 2077|   
# 2078|     p_root = _ifs_stat_root (p_iso);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def59]
libcdio-2.3.0/lib/udf/udf_fs.c:482:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'unicode16_decode(&*(const udf_dstring (*)[32])(&data[24]), min(volid_len, 31))'
libcdio-2.3.0/lib/udf/udf_fs.c:455:1: enter_function: entry to 'udf_get_volume_id'
libcdio-2.3.0/lib/udf/udf_fs.c:467:29: call_function: calling 'udf_read_sectors' from 'udf_get_volume_id'
libcdio-2.3.0/lib/udf/udf_fs.c:467:29: return_function: returning to 'udf_get_volume_id' from 'udf_read_sectors'
libcdio-2.3.0/lib/udf/udf_fs.c:467:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/udf/udf_fs.c:470:15: branch_false: ...to here
libcdio-2.3.0/lib/udf/udf_fs.c:476:7: call_function: calling 'unicode16_decode' from 'udf_get_volume_id'
libcdio-2.3.0/lib/udf/udf_fs.c:476:7: return_function: returning to 'udf_get_volume_id' from 'unicode16_decode'
libcdio-2.3.0/lib/udf/udf_fs.c:477:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/udf/udf_fs.c:480:15: branch_false: ...to here
libcdio-2.3.0/lib/udf/udf_fs.c:481:6: branch_true: following 'true' branch (when 'psz_volid' is non-NULL)...
libcdio-2.3.0/lib/udf/udf_fs.c:482:5: branch_true: ...to here
libcdio-2.3.0/lib/udf/udf_fs.c:482:5: danger: use of uninitialized value 'unicode16_decode(&*(const udf_dstring (*)[32])(&data[24]), min(volid_len, 31))' here
#  480|     volid_len = strlen(r)+1;     /* +1 for NUL terminator */
#  481|     if (psz_volid != NULL) {
#  482|->     strncpy(psz_volid, r, i_volid);
#  483|       psz_volid[i_volid-1] = 0;  /* strncpy does not always terminate the dest */
#  484|     }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def60]
libcdio-2.3.0/lib/udf/udf_fs.c:548:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'unicode16_decode(&*(udf_dstring (*)[128])(&data[84]), (unsigned int)*(logical_vol_desc_t *)(&data[0]).logvol_id[127])'
libcdio-2.3.0/lib/udf/udf_fs.c:528:1: enter_function: entry to 'udf_get_logical_volume_id'
libcdio-2.3.0/lib/udf/udf_fs.c:539:28: call_function: calling 'udf_read_sectors' from 'udf_get_logical_volume_id'
libcdio-2.3.0/lib/udf/udf_fs.c:539:28: return_function: returning to 'udf_get_logical_volume_id' from 'udf_read_sectors'
libcdio-2.3.0/lib/udf/udf_fs.c:539:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/udf/udf_fs.c:542:57: branch_false: ...to here
libcdio-2.3.0/lib/udf/udf_fs.c:542:7: call_function: calling 'unicode16_decode' from 'udf_get_logical_volume_id'
libcdio-2.3.0/lib/udf/udf_fs.c:542:7: return_function: returning to 'udf_get_logical_volume_id' from 'unicode16_decode'
libcdio-2.3.0/lib/udf/udf_fs.c:543:6: branch_false: following 'false' branch...
libcdio-2.3.0/lib/udf/udf_fs.c:546:18: branch_false: ...to here
libcdio-2.3.0/lib/udf/udf_fs.c:547:6: branch_true: following 'true' branch (when 'psz_logvolid' is non-NULL)...
libcdio-2.3.0/lib/udf/udf_fs.c:548:5: branch_true: ...to here
libcdio-2.3.0/lib/udf/udf_fs.c:548:5: danger: use of uninitialized value 'unicode16_decode(&*(udf_dstring (*)[128])(&data[84]), (unsigned int)*(logical_vol_desc_t *)(&data[0]).logvol_id[127])' here
#  546|     logvolid_len = strlen(r)+1;  /* +1 for NUL terminator */
#  547|     if (psz_logvolid != NULL) {
#  548|->     strncpy(psz_logvolid, r, i_logvolid);
#  549|       psz_logvolid[i_logvolid-1] = 0;    /* strncpy does not always terminate the dest */
#  550|     }

Error: COMPILER_WARNING (CWE-704): [#def61]
libcdio-2.3.0/src/cd-read.c: scope_hint: In function ‘process_suboption’
libcdio-2.3.0/src/cd-read.c:165:5: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  165 |     bsearch(subopt, sublist, num, sizeof(subopt_entry_t),
#      |     ^~~~~~~
#  163|   {
#  164|     subopt_entry_t *subopt_rec =
#  165|->     bsearch(subopt, sublist, num, sizeof(subopt_entry_t),
#  166|               &compare_subopts);
#  167|     if (subopt_rec != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def62]
libcdio-2.3.0/src/cd-read.c:165:5: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  163|   {
#  164|     subopt_entry_t *subopt_rec =
#  165|->     bsearch(subopt, sublist, num, sizeof(subopt_entry_t),
#  166|               &compare_subopts);
#  167|     if (subopt_rec != NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def63]
libcdio-2.3.0/src/iso-info.c:387: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: psz_newpath
#  385|           char *psz_newpath = calloc(1, sizeof(char)*i_newlen);
#  386|   
#  387|->         snprintf(psz_newpath, i_newlen, "%s%s/", psz_path, psz_dirname);
#  388|           list_udf_files(p_udf, p_udf_dirent2, psz_newpath);
#  389|           free(psz_newpath);

Error: COMPILER_WARNING (CWE-704): [#def64]
libcdio-2.3.0/src/mmc-tool.c: scope_hint: In function ‘init’
libcdio-2.3.0/src/mmc-tool.c:268:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  268 |   program_name = strrchr(argv0,'/');
#      |                ^
#  266|   {
#  267|     gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler);
#  268|->   program_name = strrchr(argv0,'/');
#  269|     program_name = program_name ? strdup(program_name+1) : strdup(argv0);
#  270|   }

Error: COMPILER_WARNING (CWE-704): [#def65]
libcdio-2.3.0/src/mmc-tool.c:268:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  266|   {
#  267|     gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler);
#  268|->   program_name = strrchr(argv0,'/');
#  269|     program_name = program_name ? strdup(program_name+1) : strdup(argv0);
#  270|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
libcdio-2.3.0/src/util.c:471:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘psz_format’ where non-null expected
libcdio-2.3.0/src/util.c:171:1: enter_function: entry to ‘fillout_device_name’
libcdio-2.3.0/src/util.c:177:6: branch_false: following ‘false’ branch (when ‘device_name’ is non-NULL)...
libcdio-2.3.0/src/util.c:178:12: branch_false: ...to here
libcdio-2.3.0/src/util.c:178:6: branch_false: following ‘false’ branch...
libcdio-2.3.0/src/util.c:181:48: branch_false: ...to here
libcdio-2.3.0/src/util.c:181:38: acquire_memory: this call could return NULL
libcdio-2.3.0/src/util.c:182:5: call_function: calling ‘report’ from ‘fillout_device_name’
#  469|     OutputDebugString(psz_format, args);
#  470|   #else
#  471|->   vfprintf (stream, psz_format, args);
#  472|   #endif
#  473|     va_end(args);

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-156.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibcdio-2.3.0-2.fc45
store-results-to/tmp/tmpj_tbwvfk/libcdio-2.3.0-2.fc45.tar.xz
time-created2026-08-03 17:07:42
time-finished2026-08-03 17:09:25
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpj_tbwvfk/libcdio-2.3.0-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpj_tbwvfk/libcdio-2.3.0-2.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9