libdnf-0.74.0-1.fc43

List of Findings

Error: COMPILER_WARNING (CWE-758): [#def1]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_common_types.dir/common_typesPYTHON_wrap.cxx:3274:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__common_types()’
# 3274 | #  define SWIG_init    PyInit__common_types
#      |                        ^~~~~~~~~~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_common_types.dir/common_typesPYTHON_wrap.cxx:17847:1: note: in expansion of macro ‘SWIG_init’
#17847 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3272|     ------------------------------------------------*/
# 3273|   #if PY_VERSION_HEX >= 0x03000000
# 3274|-> #  define SWIG_init    PyInit__common_types
# 3275|   
# 3276|   #else

Error: COMPILER_WARNING (CWE-758): [#def2]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_conf.dir/confPYTHON_wrap.cxx:3306:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__conf()’
# 3306 | #  define SWIG_init    PyInit__conf
#      |                        ^~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_conf.dir/confPYTHON_wrap.cxx:30381:1: note: in expansion of macro ‘SWIG_init’
#30381 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3304|     ------------------------------------------------*/
# 3305|   #if PY_VERSION_HEX >= 0x03000000
# 3306|-> #  define SWIG_init    PyInit__conf
# 3307|   
# 3308|   #else

Error: COMPILER_WARNING (CWE-758): [#def3]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_error.dir/errorPYTHON_wrap.cxx:3224:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__error()’
# 3224 | #  define SWIG_init    PyInit__error
#      |                        ^~~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_error.dir/errorPYTHON_wrap.cxx:3725:1: note: in expansion of macro ‘SWIG_init’
# 3725 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3222|     ------------------------------------------------*/
# 3223|   #if PY_VERSION_HEX >= 0x03000000
# 3224|-> #  define SWIG_init    PyInit__error
# 3225|   
# 3226|   #else

Error: COMPILER_WARNING (CWE-758): [#def4]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx: scope_hint: At global scope
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx:3282:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__module()’
# 3282 | #  define SWIG_init    PyInit__module
#      |                        ^~~~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx:32262:1: note: in expansion of macro ‘SWIG_init’
#32262 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3280|     ------------------------------------------------*/
# 3281|   #if PY_VERSION_HEX >= 0x03000000
# 3282|-> #  define SWIG_init    PyInit__module
# 3283|   
# 3284|   #else

Error: COMPILER_WARNING (CWE-477): [#def5]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx: scope_hint: In function ‘PyObject* _wrap_ModulePackageContainer_getDisabledStreams(PyObject*, PyObject*)’
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx:29659:42: warning[-Wdeprecated-declarations]: ‘std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > libdnf::ModulePackageContainer::getDisabledStreams()’ is deprecated: Will be removed after 2019-12-31. Use getDisabledModules() instead.
#29659 |       result = (arg1)->getDisabledStreams();
#      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx:3942: included_from: Included from here.
libdnf-0.74.0/libdnf/module/ModulePackageContainer.hpp:251:40: note: declared here
#  251 |     std::map<std::string, std::string> getDisabledStreams();
#      |                                        ^~~~~~~~~~~~~~~~~~
#29657|     {
#29658|       try {
#29659|->       result = (arg1)->getDisabledStreams();
#29660|       } catch (const libdnf::Error & e) {
#29661|         PyErr_SetString(libdnf_error, const_cast<char*>(e.what()));

Error: COMPILER_WARNING (CWE-477): [#def6]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx: scope_hint: In function ‘PyObject* _wrap_ModulePackageContainer_getResetStreams(PyObject*, PyObject*)’
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_module.dir/modulePYTHON_wrap.cxx:29729:39: warning[-Wdeprecated-declarations]: ‘std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > libdnf::ModulePackageContainer::getResetStreams()’ is deprecated: Will be removed after 2019-12-31. Use getResetModules() instead.
#29729 |       result = (arg1)->getResetStreams();
#      |                ~~~~~~~~~~~~~~~~~~~~~~~^~
libdnf-0.74.0/libdnf/module/ModulePackageContainer.hpp:263:40: note: declared here
#  263 |     std::map<std::string, std::string> getResetStreams();
#      |                                        ^~~~~~~~~~~~~~~
#29727|     {
#29728|       try {
#29729|->       result = (arg1)->getResetStreams();
#29730|       } catch (const libdnf::Error & e) {
#29731|         PyErr_SetString(libdnf_error, const_cast<char*>(e.what()));

Error: COMPILER_WARNING (CWE-758): [#def7]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_repo.dir/repoPYTHON_wrap.cxx:3784:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__repo()’
# 3784 | #  define SWIG_init    PyInit__repo
#      |                        ^~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_repo.dir/repoPYTHON_wrap.cxx:17614:1: note: in expansion of macro ‘SWIG_init’
#17614 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3782|     ------------------------------------------------*/
# 3783|   #if PY_VERSION_HEX >= 0x03000000
# 3784|-> #  define SWIG_init    PyInit__repo
# 3785|   
# 3786|   #else

Error: COMPILER_WARNING (CWE-758): [#def8]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_smartcols.dir/smartcolsPYTHON_wrap.cxx:3248:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__smartcols()’
# 3248 | #  define SWIG_init    PyInit__smartcols
#      |                        ^~~~~~~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_smartcols.dir/smartcolsPYTHON_wrap.cxx:11785:1: note: in expansion of macro ‘SWIG_init’
#11785 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3246|     ------------------------------------------------*/
# 3247|   #if PY_VERSION_HEX >= 0x03000000
# 3248|-> #  define SWIG_init    PyInit__smartcols
# 3249|   
# 3250|   #else

Error: COMPILER_WARNING (CWE-758): [#def9]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_transaction.dir/transactionPYTHON_wrap.cxx:3279:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__transaction()’
# 3279 | #  define SWIG_init    PyInit__transaction
#      |                        ^~~~~~~~~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_transaction.dir/transactionPYTHON_wrap.cxx:20944:1: note: in expansion of macro ‘SWIG_init’
#20944 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3277|     ------------------------------------------------*/
# 3278|   #if PY_VERSION_HEX >= 0x03000000
# 3279|-> #  define SWIG_init    PyInit__transaction
# 3280|   
# 3281|   #else

Error: COMPILER_WARNING (CWE-758): [#def10]
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_utils.dir/utilsPYTHON_wrap.cxx:3741:24: warning[-Wmissing-declarations]: no previous declaration for ‘PyObject* PyInit__utils()’
# 3741 | #  define SWIG_init    PyInit__utils
#      |                        ^~~~~~~~~~~~~
libdnf-0.74.0/build-py3/bindings/python/CMakeFiles/_utils.dir/utilsPYTHON_wrap.cxx:7235:1: note: in expansion of macro ‘SWIG_init’
# 7235 | SWIG_init(void) {
#      | ^~~~~~~~~
# 3739|     ------------------------------------------------*/
# 3740|   #if PY_VERSION_HEX >= 0x03000000
# 3741|-> #  define SWIG_init    PyInit__utils
# 3742|   
# 3743|   #else

Error: COMPILER_WARNING (CWE-477): [#def11]
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp: scope_hint: In function ‘gboolean dnf_repo_loader_get_repos_removable(DnfRepoLoader*, GError**)’
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp:248:31: warning[-Wdeprecated-declarations]: ‘GList* g_unix_mounts_get(guint64*)’ is deprecated: Use 'g_unix_mount_entries_get' instead
#  248 |     mounts = g_unix_mounts_get(NULL);
#      |              ~~~~~~~~~~~~~~~~~^~~~~~
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp:36: included_from: Included from here.
/usr/include/gio-unix-2.0/gio/gunixmounts.h:199:16: note: declared here
#  199 | GList *        g_unix_mounts_get                    (guint64            *time_read);
#      |                ^~~~~~~~~~~~~~~~~
#  246|   
#  247|       /* coldplug the mounts */
#  248|->     mounts = g_unix_mounts_get(NULL);
#  249|       for (l = mounts; l != NULL; l = l->next) {
#  250|           GUnixMountEntry *e =(GUnixMountEntry *) l->data;

Error: COMPILER_WARNING (CWE-477): [#def12]
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp:251:38: warning[-Wdeprecated-declarations]: ‘gboolean g_unix_mount_is_readonly(GUnixMountEntry*)’ is deprecated: Use 'g_unix_mount_entry_is_readonly' instead
#  251 |         if (!g_unix_mount_is_readonly(e))
#      |              ~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/gio-unix-2.0/gio/gunixmounts.h:125:16: note: declared here
#  125 | gboolean       g_unix_mount_is_readonly             (GUnixMountEntry    *mount_entry);
#      |                ^~~~~~~~~~~~~~~~~~~~~~~~
#  249|       for (l = mounts; l != NULL; l = l->next) {
#  250|           GUnixMountEntry *e =(GUnixMountEntry *) l->data;
#  251|->         if (!g_unix_mount_is_readonly(e))
#  252|               continue;
#  253|           if (g_strcmp0(g_unix_mount_get_fs_type(e), "iso9660") != 0)

Error: COMPILER_WARNING (CWE-477): [#def13]
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp:253:47: warning[-Wdeprecated-declarations]: ‘const char* g_unix_mount_get_fs_type(GUnixMountEntry*)’ is deprecated: Use 'g_unix_mount_entry_get_fs_type' instead
#  253 |         if (g_strcmp0(g_unix_mount_get_fs_type(e), "iso9660") != 0)
#      |                       ~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/gio-unix-2.0/gio/gunixmounts.h:115:16: note: declared here
#  115 | const char *   g_unix_mount_get_fs_type             (GUnixMountEntry    *mount_entry);
#      |                ^~~~~~~~~~~~~~~~~~~~~~~~
#  251|           if (!g_unix_mount_is_readonly(e))
#  252|               continue;
#  253|->         if (g_strcmp0(g_unix_mount_get_fs_type(e), "iso9660") != 0)
#  254|               continue;
#  255|           ret = dnf_repo_loader_add_sack_from_mount_point(self,

Error: COMPILER_WARNING (CWE-477): [#def14]
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp:256:78: warning[-Wdeprecated-declarations]: ‘const char* g_unix_mount_get_mount_path(GUnixMountEntry*)’ is deprecated: Use 'g_unix_mount_entry_get_mount_path' instead
#  256 |                                                   g_unix_mount_get_mount_path(e),
#      |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/gio-unix-2.0/gio/gunixmounts.h:100:16: note: declared here
#  100 | const char *   g_unix_mount_get_mount_path          (GUnixMountEntry    *mount_entry);
#      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  254|               continue;
#  255|           ret = dnf_repo_loader_add_sack_from_mount_point(self,
#  256|->                                                   g_unix_mount_get_mount_path(e),
#  257|                                                     &idx,
#  258|                                                     error);

Error: COMPILER_WARNING (CWE-477): [#def15]
libdnf-0.74.0/libdnf/dnf-repo-loader.cpp:263:35: warning[-Wdeprecated-declarations]: ‘void g_unix_mount_free(GUnixMountEntry*)’ is deprecated: Use 'g_unix_mount_entry_free' instead
#  263 |     g_list_foreach(mounts,(GFunc) g_unix_mount_free, NULL);
#      |                                   ^~~~~~~~~~~~~~~~~
/usr/include/gio-unix-2.0/gio/gunixmounts.h:78:16: note: declared here
#   78 | void           g_unix_mount_free                    (GUnixMountEntry    *mount_entry);
#      |                ^~~~~~~~~~~~~~~~~
#  261|       }
#  262|   out:
#  263|->     g_list_foreach(mounts,(GFunc) g_unix_mount_free, NULL);
#  264|       g_list_free(mounts);
#  265|       return ret;

Error: CPPCHECK_WARNING (CWE-562): [#def16]
libdnf-0.74.0/libdnf/hy-iutil.cpp:548: error[returnDanglingLifetime]: Returning pointer to local variable 'dup' that will be invalid when returning.
#  546|   {
#  547|       char *dup = pool_alloctmpspace(pool, strlen(s) + 1);
#  548|->     return strcpy(dup, s);
#  549|   }
#  550|   

Error: COMPILER_WARNING: [#def17]
libdnf-0.74.0/libdnf/hy-package.cpp:58:3: warning[-Wodr]: type ‘struct DnfPackagePrivate’ violates the C++ One Definition Rule
#   58 | } DnfPackagePrivate;
#      |   ^
libdnf-0.74.0/libdnf/dnf-package.cpp:62:3: note: a different type is defined in another translation unit
#   62 | } DnfPackagePrivate;
#      |   ^
libdnf-0.74.0/libdnf/hy-package.cpp:55:22: note: the first difference of corresponding definitions is field ‘loaded’
#   55 |     gboolean         loaded;
#      |                      ^
libdnf-0.74.0/libdnf/dnf-package.cpp:54:22: note: a field with different name is defined in another translation unit
#   54 |     char            *checksum_str;
#      |                      ^
#   56|       Id               id;
#   57|       DnfSack         *sack;
#   58|-> } DnfPackagePrivate;
#   59|   
#   60|   G_DEFINE_TYPE_WITH_PRIVATE(DnfPackage, dnf_package, G_TYPE_OBJECT)

Error: COMPILER_WARNING (CWE-252): [#def18]
libdnf-0.74.0/libdnf/utils/smartcols/Table.cpp: scope_hint: In member function ‘void Table::removeColumn(const std::shared_ptr<Column>&)’
libdnf-0.74.0/libdnf/utils/smartcols/Table.cpp:104:16: warning[-Wunused-result]: ignoring return value of ‘_FIter std::remove(_FIter, _FIter, const _Tp&) [with _FIter = __gnu_cxx::__normal_iterator<shared_ptr<Column>*, vector<shared_ptr<Column> > >; _Tp = shared_ptr<Column>]’, declared with attribute ‘nodiscard’
#  104 |     std::remove(std::begin(columns), std::end(columns), column);
#      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/15/algorithm:63: included_from: Included from here.
libdnf-0.74.0/libdnf/utils/tinyformat/tinyformat.hpp:144: included_from: Included from here.
libdnf-0.74.0/libdnf/utils/smartcols/Table.hpp:28: included_from: Included from here.
libdnf-0.74.0/libdnf/utils/smartcols/Table.cpp:21: included_from: Included from here.
/usr/include/c++/15/bits/stl_algo.h:772:5: note: declared here
#  772 |     remove(_ForwardIterator __first, _ForwardIterator __last,
#      |     ^~~~~~
#  102|   void Table::removeColumn(const std::shared_ptr<Column> &column)
#  103|   {
#  104|->     std::remove(std::begin(columns), std::end(columns), column);
#  105|       scols_table_remove_column(table, column->column);
#  106|   }

Error: COMPILER_WARNING (CWE-252): [#def19]
libdnf-0.74.0/libdnf/utils/smartcols/Table.cpp: scope_hint: In member function ‘void Table::removeLine(const std::shared_ptr<Line>&)’
libdnf-0.74.0/libdnf/utils/smartcols/Table.cpp:116:16: warning[-Wunused-result]: ignoring return value of ‘_FIter std::remove(_FIter, _FIter, const _Tp&) [with _FIter = __gnu_cxx::__normal_iterator<shared_ptr<Line>*, vector<shared_ptr<Line> > >; _Tp = shared_ptr<Line>]’, declared with attribute ‘nodiscard’
#  116 |     std::remove(std::begin(lines), std::end(lines), line);
#      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/15/bits/stl_algo.h:772:5: note: declared here
#  772 |     remove(_ForwardIterator __first, _ForwardIterator __last,
#      |     ^~~~~~
#  114|   void Table::removeLine(const std::shared_ptr<Line> &line)
#  115|   {
#  116|->     std::remove(std::begin(lines), std::end(lines), line);
#  117|       scols_table_remove_line(table, line->line);
#  118|   }

Error: CPPCHECK_WARNING (CWE-398): [#def20]
libdnf-0.74.0/libdnf/utils/sqlite3/Sqlite3.hpp:337: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  335|       }
#  336|   
#  337|->     ~SQLite3() { close(); }
#  338|   
#  339|       const std::string &getPath() const { return path; }

Error: COMPILER_WARNING (CWE-685): [#def21]
libdnf-0.74.0/tests/hawkey/test_suites.h:24: included_from: Included from here.
libdnf-0.74.0/tests/hawkey/test_goal.cpp:38: included_from: Included from here.
libdnf-0.74.0/tests/hawkey/test_goal.cpp: scope_hint: In function ‘DnfPackage* get_latest_pkg(DnfSack*, const char*)’
libdnf-0.74.0/tests/hawkey/test_goal.cpp:54:17: warning[-Wformat-extra-args]: too many arguments for format
#   54 |                 "get_latest_pkg() failed finding '%s'.", name);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdnf-0.74.0/tests/hawkey/test_goal.cpp: scope_hint: In instantiation of ‘void assert_list_names(bool, GPtrArray*, ...) [with const char* (* getCharFromPackage)(DnfPackage*) = dnf_package_get_name; GPtrArray = _GPtrArray]’
#/builddir/build/BUILD/libdnf-0.74.0/tests/hawkey/test_goal.cpp:474:45:   required from here
#  474 |     assert_list_names<&dnf_package_get_name>(true, plist, "penny", NULL);
#      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   52|       GPtrArray *plist = hy_query_run(q);
#   53|       fail_unless(plist->len == 1,
#   54|->                 "get_latest_pkg() failed finding '%s'.", name);
#   55|       auto pkg = static_cast<DnfPackage *>(g_object_ref(g_ptr_array_index(plist, 0)));
#   56|       hy_query_free(q);

Error: COMPILER_WARNING (CWE-685): [#def22]
libdnf-0.74.0/tests/hawkey/test_goal.cpp:439:18: warning[-Wformat-extra-args]: too many arguments for format
#  439 |             fail("assert_list_names(): list too short");
#      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  437|       while ((name = va_arg(names, char *)) != NULL) {
#  438|           if (i++ >= count) {
#  439|->             fail("assert_list_names(): list too short");
#  440|           }
#  441|           bool found = false;

Error: COMPILER_WARNING (CWE-685): [#def23]
libdnf-0.74.0/tests/hawkey/test_goal.cpp:449:32: warning[-Wformat-extra-args]: too many arguments for format
#  449 |             fail_unless(false, "assert_list_names(): element '%s' %sfound '%zu'",
#      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  447|           }
#  448|           if ((wanted && !found) || (!wanted && found)) {
#  449|->             fail_unless(false, "assert_list_names(): element '%s' %sfound '%zu'",
#  450|                           name, wanted ? "not ": "", stringVector.size());
#  451|           }

Error: COMPILER_WARNING (CWE-685): [#def24]
libdnf-0.74.0/tests/hawkey/test_goal.cpp:458:33: warning[-Wformat-extra-args]: too many arguments for format
#  458 |         fail_unless(i == count, "assert_list_names(): too many items in the list (%d vs %d)", i, count);
#      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libdnf-0.74.0/tests/hawkey/test_goal.cpp: scope_hint: In instantiation of ‘void assert_list_names(bool, GPtrArray*, ...) [with const char* (* getCharFromPackage)(DnfPackage*) = dnf_package_get_nevra; GPtrArray = _GPtrArray]’
#/builddir/build/BUILD/libdnf-0.74.0/tests/hawkey/test_goal.cpp:1064:50:   required from here
# 1064 |         assert_list_names<&dnf_package_get_nevra>(true, plist, "bloop-2.0-1.noarch", "dog-1-2.x86_64", "fool-1-5.noarch",
#      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1065 |             "flying-3.1-0.x86_64", "pilchard-1.2.4-1.x86_64", "pilchard-1.2.4-1.i686", NULL);
#      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  456|       // already checked above.
#  457|       if (wanted) {
#  458|->         fail_unless(i == count, "assert_list_names(): too many items in the list (%d vs %d)", i, count);
#  459|       }
#  460|       va_end(names);

Error: CPPCHECK_WARNING (CWE-476): [#def25]
libdnf-0.74.0/tests/hawkey/test_iutil.cpp:42: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   40|       FILE *fp = fopen(filename, "w+");
#   41|       fail_if(fp == NULL);
#   42|->     fail_unless(fwrite("empty", 5, 1, fp) == 1);
#   43|       fclose(fp);
#   44|   }

Error: CPPCHECK_WARNING (CWE-476): [#def26]
libdnf-0.74.0/tests/hawkey/test_iutil.cpp:43: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   41|       fail_if(fp == NULL);
#   42|       fail_unless(fwrite("empty", 5, 1, fp) == 1);
#   43|->     fclose(fp);
#   44|   }
#   45|   

Error: CPPCHECK_WARNING (CWE-476): [#def27]
libdnf-0.74.0/tests/hawkey/test_iutil.cpp:129: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  127|       fail_unless(dnf_solvfile);
#  128|       fail_unless(solv_userdata_verify(dnf_solvfile.get(), cs_computed));
#  129|->     fclose(fp);
#  130|   
#  131|       g_free(new_file);

Error: CPPCHECK_WARNING (CWE-476): [#def28]
libdnf-0.74.0/tests/hawkey/test_sack.cpp:170: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  168|       FILE *fp = g_fopen (path_null_rpm, "w");
#  169|       fail_unless (fp != NULL);
#  170|->     fclose (fp);
#  171|       fail_unless (dnf_sack_add_cmdline_package (sack, path_null_rpm) == NULL);
#  172|   }

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-105.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibdnf-0.74.0-1.fc43
store-results-to/tmp/tmp2y4md70c/libdnf-0.74.0-1.fc43.tar.xz
time-created2025-04-25 14:05:34
time-finished2025-04-25 14:08:56
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp2y4md70c/libdnf-0.74.0-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp2y4md70c/libdnf-0.74.0-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9