createrepo_c-1.1.2-2.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/checksum.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/cmd_parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/compression_wrapper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-404): [#def4]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/compression_wrapper.c:197: error[resourceLeak]: Resource leak: file
#  195|           g_debug("%s: Unable to read bytes from file for magic number detection, assuming uncompressed (%s)",
#  196|               __func__, filename);
#  197|->         return CR_CW_NO_COMPRESSION;
#  198|       }
#  199|       fclose(file);

Error: CPPCHECK_WARNING: [#def5]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/createrepo_c.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def6]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/deltarpms.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def7]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-252): [#def8]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c: scope_hint: In function ‘get_checksum’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:409:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  409 |         write(fd, checksum, strlen(checksum));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  407|           }
#  408|   
#  409|->         write(fd, checksum, strlen(checksum));
#  410|           close(fd);
#  411|           if (!cr_move_recursive(template, cachefn, &tmp_err)) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c: scope_hint: In function ‘cr_dumper_thread’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:606:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘stat_buf.st_mtim.tv_sec’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:20: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:548:21: note: in expansion of macro ‘g_strdup’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c: scope_hint: In function ‘cr_dumper_thread’
/usr/include/glib-2.0/glib.h:64: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:602:13: note: in expansion of macro ‘g_debug’
/usr/include/bits/stat.h:25: included_from: Included from here.
/usr/include/sys/stat.h:101: included_from: Included from here.
/usr/include/glib-2.0/glib/gstdio.h:27: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:21: included_from: Included from here.
#  604|               if (udata->skip_stat) {
#  605|                   old_used = TRUE;
#  606|->             } else if (stat_buf.st_mtime == md->time_file
#  607|                          && stat_buf.st_size == md->size_package
#  608|                          && !strcmp(udata->checksum_type_str, md->checksum_type))

Error: CLANG_WARNING: [#def10]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/dumper_thread.c:606:42: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  604|               if (udata->skip_stat) {
#  605|                   old_used = TRUE;
#  606|->             } else if (stat_buf.st_mtime == md->time_file
#  607|                          && stat_buf.st_size == md->size_package
#  608|                          && !strcmp(udata->checksum_type_str, md->checksum_type))

Error: CPPCHECK_WARNING: [#def11]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/helpers.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def12]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/koji.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def13]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/load_metadata.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def14]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/locate_metadata.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def15]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/mergerepo_c.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def16]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c: scope_hint: In function ‘cr_copy_file’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:422:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(src, "rb")’
#  420|   
#  421|       // Open src file
#  422|->     if ((orig = fopen(src, "rb")) == NULL) {
#  423|           const gchar * fopen_error = g_strerror(errno);
#  424|           g_debug("%s: Cannot open source file %s (%s)", __func__, src,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:422:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(src, "rb")’
#  420|   
#  421|       // Open src file
#  422|->     if ((orig = fopen(src, "rb")) == NULL) {
#  423|           const gchar * fopen_error = g_strerror(errno);
#  424|           g_debug("%s: Cannot open source file %s (%s)", __func__, src,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:432:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(dst, "wb")’
#  430|   
#  431|       // Open dst file
#  432|->     if ((new = fopen(dst, "wb")) == NULL) {
#  433|           const gchar * fopen_error = g_strerror(errno);
#  434|           g_debug("%s: Cannot open destination file %s (%s)", __func__, dst,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:432:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(dst, "wb")’
#  430|   
#  431|       // Open dst file
#  432|->     if ((new = fopen(dst, "wb")) == NULL) {
#  433|           const gchar * fopen_error = g_strerror(errno);
#  434|           g_debug("%s: Cannot open destination file %s (%s)", __func__, dst,

Error: CPPCHECK_WARNING (CWE-404): [#def21]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:438: error[resourceLeak]: Resource leak: orig
#  436|           g_set_error(err, ERR_DOMAIN, CRE_IO,
#  437|                       "Cannot open file %s: %s", dst, fopen_error);
#  438|->         return FALSE;
#  439|       }
#  440|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c: scope_hint: In function ‘cr_download’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:748:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(dst, "wb")’
#  746|   
#  747|       // Open dst file
#  748|->     file = fopen(dst, "wb");
#  749|       if (!file) {
#  750|           g_set_error(err, ERR_DOMAIN, CRE_IO,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:748:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(dst, "wb")’
#  746|   
#  747|       // Open dst file
#  748|->     file = fopen(dst, "wb");
#  749|       if (!file) {
#  750|           g_set_error(err, ERR_DOMAIN, CRE_IO,

Error: CPPCHECK_WARNING (CWE-404): [#def24]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:767: error[resourceLeak]: Resource leak: file
#  765|                       "curl_easy_setopt failed(CURLOPT_ERRORBUFFER): %s",
#  766|                       curl_easy_strerror(rcode));
#  767|->         return CRE_CURL;
#  768|       }
#  769|   

Error: CPPCHECK_WARNING (CWE-404): [#def25]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/misc.c:778: error[resourceLeak]: Resource leak: file
#  776|                       curl_easy_strerror(rcode));
#  777|           remove(dst);
#  778|->         return CRE_CURL;
#  779|       }
#  780|   

Error: CPPCHECK_WARNING: [#def26]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/modifyrepo_c.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def27]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/modifyrepo_shared.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def28]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/package.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def29]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/parsehdr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/parsehdr.c: scope_hint: In function ‘cr_package_from_header’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/parsehdr.c:282:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dir_list’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/parsehdr.c: scope_hint: In function ‘cr_package_from_header’
#  280|           dir_list = malloc(sizeof(char *) * dir_count);
#  281|           while (rpmtdNext(dirnames) != -1) {
#  282|->             dir_list[x] = cr_safe_string_chunk_insert(pkg->chunk, rpmtdGetString(dirnames));
#  283|               x++;
#  284|           }

Error: CPPCHECK_WARNING: [#def31]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/repomd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/repomd.c: scope_hint: In function ‘cr_repomd_record_fill’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/repomd.c:287:75: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  285|               }
#  286|               md->checksum_open_type = g_string_chunk_insert(md->chunk, checksum_str);
#  287|->             md->checksum_open = g_string_chunk_insert(md->chunk, open_stat->checksum);
#  288|               if (md->size_open == G_GINT64_CONSTANT(-1))
#  289|                   md->size_open = open_stat->size;

Error: CPPCHECK_WARNING: [#def33]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqlite.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def34]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c: scope_hint: In function ‘gen_new_repomd’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:589:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_build_filename(tmp_out_repo, "repomd.xml", 0), "w")’
/usr/include/glib-2.0/glib.h:64: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:20: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:1018:5: note: in expansion of macro ‘g_debug’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:730:23: note: in expansion of macro ‘g_strdup’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c: scope_hint: In function ‘gen_new_repomd’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:38: included_from: Included from here.
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:875:14: note: in expansion of macro ‘cr_db_open_filelists’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:882:14: note: in expansion of macro ‘cr_db_open_other’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1245:45: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gstrfuncs.h:166:11: note: in expansion of macro ‘G_UNLIKELY’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:506:9: note: in expansion of macro ‘g_str_has_prefix’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:543:9: note: in expansion of macro ‘g_debug’
#  587|       // Write the repomd.xml
#  588|       _cleanup_file_fclose_ FILE *f_repomd = NULL;
#  589|->     if (!(f_repomd = fopen(repomd_path, "w"))) {
#  590|           g_set_error(err, CREATEREPO_C_ERROR, CRE_IO,
#  591|                       "Cannot open %s: %s", repomd_path, g_strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:589:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_build_filename(tmp_out_repo, "repomd.xml", 0), "w")’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:1018:5: note: in expansion of macro ‘g_debug’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:730:23: note: in expansion of macro ‘g_strdup’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c: scope_hint: In function ‘gen_new_repomd’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:875:14: note: in expansion of macro ‘cr_db_open_filelists’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:882:14: note: in expansion of macro ‘cr_db_open_other’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1245:45: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gstrfuncs.h:166:11: note: in expansion of macro ‘G_UNLIKELY’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:506:9: note: in expansion of macro ‘g_str_has_prefix’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:543:9: note: in expansion of macro ‘g_debug’
#  587|       // Write the repomd.xml
#  588|       _cleanup_file_fclose_ FILE *f_repomd = NULL;
#  589|->     if (!(f_repomd = fopen(repomd_path, "w"))) {
#  590|           g_set_error(err, CREATEREPO_C_ERROR, CRE_IO,
#  591|                       "Cannot open %s: %s", repomd_path, g_strerror(errno));

Error: CPPCHECK_WARNING (CWE-404): [#def37]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/sqliterepo_c.c:602: error[resourceLeak]: Resource leak: f_repomd
#  600|       cr_repomd_free(repomd);
#  601|   
#  602|->     return TRUE;
#  603|   }
#  604|   

Error: CPPCHECK_WARNING: [#def38]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_dump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def39]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_dump_primary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def40]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_dump_repomd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def41]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_dump_updateinfo.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def42]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c: scope_hint: In function ‘write_modified_header’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c:365:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cr_file’
#  363|       gchar *pointer_to_pkgs_end = pointer_to_pkgs + task_count_string_len;
#  364|   
#  365|->     bytes_written += cr_write(cr_file->f, header_buf, pointer_to_pkgs - header_buf, &tmp_err);
#  366|       if (!tmp_err)
#  367|           bytes_written += cr_write(cr_file->f, package_count_string, package_count_string_len, &tmp_err);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c: scope_hint: In function ‘cr_rewrite_header_package_count’
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c:416:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  414|               size_t zck_dict_size = 0;
#  415|               if (g_file_get_contents(zck_dict_file, &zck_dict, &zck_dict_size, &tmp_err)){
#  416|->                 cr_set_dict(new_file->f, zck_dict, zck_dict_size, &tmp_err);
#  417|                   g_free(zck_dict);
#  418|               } else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c:446:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  444|               len_read = cr_get_zchunk_with_index(original_file, zchunk_index, &copy_buf, &tmp_err);
#  445|               if (!tmp_err)
#  446|->                 cr_write(new_file->f, copy_buf, len_read, &tmp_err);
#  447|               if (!tmp_err)
#  448|                   cr_end_chunk(new_file->f, &tmp_err);

Error: CLANG_WARNING: [#def46]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c:466:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_file'
#  464|               g_propagate_prefixed_error(err, tmp_err, "Error encountered while recompressing:");
#  465|               cr_xmlfile_close(new_file, NULL);
#  466|->             cr_close(original_file, NULL); 
#  467|               g_free(tmp_xml_filename);
#  468|               return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c:476:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  474|               len_read = cr_read(original_file, copy_buf, XML_RECOMPRESS_BUFFER_SIZE, &tmp_err);
#  475|               if (!tmp_err)
#  476|->                 cr_write(new_file->f, copy_buf, len_read, &tmp_err);
#  477|               if (tmp_err) {
#  478|                   g_propagate_prefixed_error(err, tmp_err, "Error encountered while recompressing:");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_file.c:487:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  485|       }
#  486|   
#  487|->     new_file->header = 1;
#  488|       new_file->footer = 1;
#  489|   

Error: CPPCHECK_WARNING: [#def49]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def50]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_filelists.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def51]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_filelists.c:180:14: warning[core.NullDereference]: Access to field 'epoch' results in a dereference of a null pointer (loaded from field 'pkg')
#  178|           // Version string insert only if them don't already exists
#  179|   
#  180|->         if (!pd->pkg->epoch)
#  181|               pd->pkg->epoch = cr_safe_string_chunk_insert(pd->pkg->chunk,
#  182|                                               cr_find_attr("epoch", attr));

Error: CLANG_WARNING: [#def52]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_filelists.c:194:14: warning[core.NullDereference]: Access to field 'files_checksum_type' results in a dereference of a null pointer (loaded from field 'pkg')
#  192|           assert(pd->pkg);
#  193|   
#  194|->         if (!pd->pkg->files_checksum_type)
#  195|               pd->pkg->files_checksum_type = cr_safe_string_chunk_insert(pd->pkg->chunk,
#  196|                                                              cr_find_attr("type", attr));

Error: CPPCHECK_WARNING: [#def53]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_other.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def54]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_other.c:172:14: warning[core.NullDereference]: Access to field 'epoch' results in a dereference of a null pointer (loaded from field 'pkg')
#  170|           // Version string insert only if them don't already exists
#  171|   
#  172|->         if (!pd->pkg->epoch)
#  173|               pd->pkg->epoch = cr_safe_string_chunk_insert(pd->pkg->chunk,
#  174|                                               cr_find_attr("epoch", attr));

Error: CLANG_WARNING: [#def55]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_other.c:194:55: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from field 'pkg')
#  192|                           "Missing attribute \"author\" of a package element");
#  193|           else
#  194|->             changelog->author = g_string_chunk_insert(pd->pkg->chunk, val);
#  195|   
#  196|           val = cr_find_attr("date", attr);

Error: CPPCHECK_WARNING: [#def56]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_primary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def57]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_primary.c:223:14: warning[core.NullDereference]: Access to field 'epoch' results in a dereference of a null pointer (loaded from field 'pkg')
#  221|           // They could be already filled by filelists or other parser.
#  222|   
#  223|->         if (!pd->pkg->epoch)
#  224|               pd->pkg->epoch = cr_safe_string_chunk_insert(pd->pkg->chunk,
#  225|                                               cr_find_attr("epoch", attr));

Error: CLANG_WARNING: [#def58]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_primary.c:241:60: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from field 'pkg')
#  239|                           "Missing attribute \"type\" of a checksum element");
#  240|           else
#  241|->             pd->pkg->checksum_type = g_string_chunk_insert(pd->pkg->chunk, val);
#  242|           break;
#  243|   

Error: CLANG_WARNING: [#def59]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_primary.c:303:60: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from field 'pkg')
#  301|                           "Missing attribute \"href\" of a location element");
#  302|           else
#  303|->             pd->pkg->location_href = g_string_chunk_insert(pd->pkg->chunk, val);
#  304|   
#  305|           val = cr_find_attr("xml:base", attr);

Error: CLANG_WARNING: [#def60]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_primary.c:366:47: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from field 'pkg')
#  364|                           "Missing attribute \"name\" of an entry element");
#  365|           else
#  366|->             dep->name = g_string_chunk_insert(pd->pkg->chunk, val);
#  367|   
#  368|           // Rest of attrs is optional

Error: CPPCHECK_WARNING: [#def61]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_repomd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def62]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_updateinfo.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def63]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_updateinfo.c:292:50: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from variable 'module')
#  290|           val = cr_find_attr("name", attr);
#  291|           if (val)
#  292|->             module->name = g_string_chunk_insert(module->chunk, val);
#  293|   
#  294|           val = cr_find_attr("stream", attr);

Error: CLANG_WARNING: [#def64]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_updateinfo.c:296:52: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from variable 'module')
#  294|           val = cr_find_attr("stream", attr);
#  295|           if (val)
#  296|->             module->stream = g_string_chunk_insert(module->chunk, val);
#  297|   
#  298|           val = cr_find_attr("version", attr);

Error: CLANG_WARNING: [#def65]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_updateinfo.c:302:29: warning[core.NullDereference]: Access to field 'version' results in a dereference of a null pointer (loaded from variable 'module')
#  300|               gchar *endptr;
#  301|               errno = 0;
#  302|->             module->version = strtoull(val, &endptr, 10);
#  303|               if ((errno == ERANGE && (module->version == ULLONG_MAX))
#  304|                    || (errno != 0 && module->version == 0)) {

Error: CLANG_WARNING: [#def66]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_updateinfo.c:314:53: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from variable 'module')
#  312|           val = cr_find_attr("context", attr);
#  313|           if (val)
#  314|->             module->context = g_string_chunk_insert(module->chunk, val);
#  315|   
#  316|           val = cr_find_attr("arch", attr);

Error: CLANG_WARNING: [#def67]
createrepo_c-1.1.2-build/createrepo_c-1.1.2/src/xml_parser_updateinfo.c:318:50: warning[core.NullDereference]: Access to field 'chunk' results in a dereference of a null pointer (loaded from variable 'module')
#  316|           val = cr_find_attr("arch", attr);
#  317|           if (val)
#  318|->             module->arch = g_string_chunk_insert(module->chunk, val);
#  319|   
#  320|           break;

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-53.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namecreaterepo_c-1.1.2-2.fc41
store-results-to/tmp/tmpz0s_5mga/createrepo_c-1.1.2-2.fc41.tar.xz
time-created2024-07-03 12:17:32
time-finished2024-07-03 12:19:12
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpz0s_5mga/createrepo_c-1.1.2-2.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpz0s_5mga/createrepo_c-1.1.2-2.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9