dnf5-5.2.17.0-2.fc44

List of Findings

Error: CPPCHECK_WARNING (CWE-825): [#def1]
dnf5-5.2.17.0/dnf5/commands/history/transaction_id.cpp:96: error[derefInvalidIterator]: Dereference of an invalid iterator: trans_id_cache.end()
#   94|               if (id_range.first < 0) {
#   95|                   if (static_cast<uint64_t>(std::abs(id_range.first)) <= trans_id_cache.size()) {
#   96|->                     id_range.first = trans_id_cache.end()[static_cast<trans_id_cache_it_type>(id_range.first)];
#   97|                   } else {
#   98|                       // X in last-X goes out of range; we start with ID 0 if

Error: CPPCHECK_WARNING (CWE-825): [#def2]
dnf5-5.2.17.0/dnf5/commands/history/transaction_id.cpp:107: error[derefInvalidIterator]: Dereference of an invalid iterator: trans_id_cache.end()
#  105|               if (id_range.second < 0) {
#  106|                   if (static_cast<uint64_t>(std::abs(id_range.second)) <= trans_id_cache.size()) {
#  107|->                     id_range.second = trans_id_cache.end()[static_cast<trans_id_cache_it_type>(id_range.second)];
#  108|                   } else {
#  109|                       // X in last-X goes out of range for a range upper

Error: CPPCHECK_WARNING (CWE-758): [#def3]
dnf5-5.2.17.0/dnf5daemon-server/transaction.cpp:31: error[missingReturn]: Found an exit path from function with non-void return type that has missing return statement
#   29|   
#   30|   RpmTransactionItemActions transaction_package_to_action(const libdnf5::base::TransactionPackage & tspkg) {
#   31|->     switch (tspkg.get_action()) {
#   32|           case libdnf5::base::TransactionPackage::Action::INSTALL:
#   33|               return RpmTransactionItemActions::INSTALL;

Error: CPPCHECK_WARNING (CWE-562): [#def4]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1442: error[returnDanglingLifetime]: Returning object that points to local variable 'arg' that will be invalid when returning.
# 1440|       auto * ptr = arg.get();
# 1441|       p_impl->cmds.push_back(std::move(arg));
# 1442|->     return ptr;
# 1443|   }
# 1444|   

Error: CPPCHECK_WARNING (CWE-562): [#def5]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1450: error[returnDanglingLifetime]: Returning object that points to local variable 'arg' that will be invalid when returning.
# 1448|       auto * ptr = arg.get();
# 1449|       p_impl->cmds.push_back(std::move(arg));
# 1450|->     return ptr;
# 1451|   }
# 1452|   

Error: CPPCHECK_WARNING (CWE-562): [#def6]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1457: error[returnDanglingLifetime]: Returning object that points to local variable 'arg' that will be invalid when returning.
# 1455|       auto * ptr = arg.get();
# 1456|       p_impl->named_args.push_back(std::move(arg));
# 1457|->     return ptr;
# 1458|   }
# 1459|   

Error: CPPCHECK_WARNING (CWE-562): [#def7]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1465: error[returnDanglingLifetime]: Returning object that points to local variable 'arg' that will be invalid when returning.
# 1463|       auto * ptr = arg.get();
# 1464|       p_impl->pos_args.push_back(std::move(arg));
# 1465|->     return ptr;
# 1466|   }
# 1467|   

Error: CPPCHECK_WARNING (CWE-562): [#def8]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1476: error[returnDanglingLifetime]: Returning object that points to local variable 'arg' that will be invalid when returning.
# 1474|       auto * ptr = arg.get();
# 1475|       p_impl->pos_args.push_back(std::move(arg));
# 1476|->     return ptr;
# 1477|   }
# 1478|   

Error: CPPCHECK_WARNING (CWE-562): [#def9]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1483: error[returnDanglingLifetime]: Returning object that points to local variable 'group' that will be invalid when returning.
# 1481|       auto * ptr = group.get();
# 1482|       p_impl->groups.push_back(std::move(group));
# 1483|->     return ptr;
# 1484|   }
# 1485|   

Error: CPPCHECK_WARNING (CWE-758): [#def10]
dnf5-5.2.17.0/libdnf5-cli/argument_parser.cpp:1580: error[missingReturn]: Found an exit path from function with non-void return type that has missing return statement
# 1578|       if constexpr (std::is_same<Arg, ArgumentParser::PositionalArg>::value) {
# 1579|           return command.get_positional_args();
# 1580|->     }
# 1581|   }
# 1582|   

Error: CPPCHECK_WARNING (CWE-909): [#def11]
dnf5-5.2.17.0/libdnf5/base/goal.cpp:3042: error[uninitStructMember]: Uninitialized struct member: group_replay.package_types
# 3040|               }
# 3041|   
# 3042|->             replay.groups.push_back(group_replay);
# 3043|           }
# 3044|   

Error: CPPCHECK_WARNING (CWE-457): [#def12]
dnf5-5.2.17.0/libdnf5/base/goal.cpp:3042: error[uninitvar]: Uninitialized variable: group_replay.package_types
# 3040|               }
# 3041|   
# 3042|->             replay.groups.push_back(group_replay);
# 3043|           }
# 3044|   

Error: CPPCHECK_WARNING (CWE-562): [#def13]
dnf5-5.2.17.0/libdnf5/repo/repo_sack.cpp:178: error[danglingLifetime]: Non-local variable 'p_impl->cmdline_repo' will use pointer to local variable 'repo'.
#  176|           std::unique_ptr<Repo> repo(new Repo(p_impl->base, CMDLINE_REPO_NAME, Repo::Type::COMMANDLINE));
#  177|           repo->get_config().get_build_cache_option().set(libdnf5::Option::Priority::RUNTIME, false);
#  178|->         p_impl->cmdline_repo = repo.get();
#  179|           add_item(std::move(repo));
#  180|       }

Error: CPPCHECK_WARNING (CWE-562): [#def14]
dnf5-5.2.17.0/libdnf5/repo/repo_sack.cpp:321: error[danglingLifetime]: Non-local variable 'p_impl->system_repo' will use pointer to local variable 'repo'.
#  319|           // TODO(mblaha): re-enable caching once we can reliably detect whether system repo is up-to-date
#  320|           repo->get_config().get_build_cache_option().set(libdnf5::Option::Priority::RUNTIME, false);
#  321|->         p_impl->system_repo = repo.get();
#  322|           add_item(std::move(repo));
#  323|       }

Error: CPPCHECK_WARNING (CWE-909): [#def15]
dnf5-5.2.17.0/libdnf5/system/state.cpp:137: error[uninitStructMember]: Uninitialized struct member: group_state.package_types
#  135|           }
#  136|   
#  137|->         return group_state;
#  138|       }
#  139|   };

Error: CPPCHECK_WARNING (CWE-457): [#def16]
dnf5-5.2.17.0/libdnf5/system/state.cpp:137: warning[uninitvar]: Uninitialized variable: group_state.package_types
#  135|           }
#  136|   
#  137|->         return group_state;
#  138|       }
#  139|   };

Error: CPPCHECK_WARNING (CWE-457): [#def17]
dnf5-5.2.17.0/libdnf5/utils/fs/file.cpp:248: error[legacyUninitvar]: Uninitialized variable: length_to_end
#  246|       if (length_detected) {
#  247|           // The file length is known. Allocate memory at once and read data.
#  248|->         std::size_t to_read = count == 0 ? length_to_end : std::min(length_to_end, count);
#  249|           res.resize(to_read);
#  250|           std::size_t size = read(res.data(), to_read);

Error: CPPCHECK_WARNING (CWE-398): [#def18]
dnf5-5.2.17.0/libdnf5/utils/sqlite3/sqlite3.hpp:328: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  326|       explicit SQLite3(const std::string & db_path) : path{db_path}, db{nullptr} { open(); }
#  327|   
#  328|->     ~SQLite3() { close(); }
#  329|   
#  330|       const std::string & get_path() const { return path; }

Error: CPPCHECK_WARNING (CWE-476): [#def19]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5/CMakeFiles/perl5_advisory.dir/advisoryPERL_wrap.cxx:1450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1448|     mg = mg_find(sv,'U');
# 1449|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1450|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1451|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1452|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def20]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5/CMakeFiles/perl5_common.dir/commonPERL_wrap.cxx:1450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1448|     mg = mg_find(sv,'U');
# 1449|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1450|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1451|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1452|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def21]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5/CMakeFiles/perl5_exception.dir/exceptionPERL_wrap.cxx:1450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1448|     mg = mg_find(sv,'U');
# 1449|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1450|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1451|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1452|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def22]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5/CMakeFiles/perl5_plugin.dir/pluginPERL_wrap.cxx:1451: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1449|     mg = mg_find(sv,'U');
# 1450|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1451|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1452|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1453|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def23]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5/CMakeFiles/perl5_transaction.dir/transactionPERL_wrap.cxx:1450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1448|     mg = mg_find(sv,'U');
# 1449|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1450|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1451|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1452|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def24]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5/CMakeFiles/perl5_utils.dir/utilsPERL_wrap.cxx:1450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1448|     mg = mg_find(sv,'U');
# 1449|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1450|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1451|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1452|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def25]
dnf5-5.2.17.0/redhat-linux-build/bindings/perl5/libdnf5_cli/CMakeFiles/perl5_progressbar.dir/progressbarPERL_wrap.cxx:1450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mg->mg_virtual
# 1448|     mg = mg_find(sv,'U');
# 1449|     mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
# 1450|->   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
# 1451|     mg->mg_virtual->svt_set = (SwigMagicFunc) set;
# 1452|     mg->mg_virtual->svt_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def26]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_advisory.dir/advisoryRUBY_wrap.cxx:1661: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1659|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1660|     char *klass_name = (char *) malloc(klass_len);
# 1661|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1662|     if (NIL_P(_cSWIG_Pointer)) {
# 1663|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def27]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_advisory.dir/advisoryRUBY_wrap.cxx:1719: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1717|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1718|       klass_name = (char *) malloc(klass_len);
# 1719|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1720|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1721|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def28]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_advisory.dir/advisoryRUBY_wrap.cxx:2683: error[uninitvar]: Uninitialized variable: v
# 2681|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2682|           return SWIG_OverflowError;
# 2683|->       if (val) *val = v;
# 2684|         return SWIG_OK;
# 2685|       }

Error: CPPCHECK_WARNING (CWE-457): [#def29]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_advisory.dir/advisoryRUBY_wrap.cxx:2729: error[uninitvar]: Uninitialized variable: v
# 2727|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2728|           return SWIG_OverflowError;
# 2729|->       if (val) *val = v;
# 2730|         return SWIG_OK;
# 2731|       }

Error: CPPCHECK_WARNING (CWE-457): [#def30]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_advisory.dir/advisoryRUBY_wrap.cxx:2786: error[uninitvar]: Uninitialized variable: v
# 2784|       a[1] = (VALUE)(&v);
# 2785|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2786|->       if (val) *val = v;
# 2787|         return SWIG_OK;
# 2788|       }

Error: CPPCHECK_WARNING (CWE-457): [#def31]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_advisory.dir/advisoryRUBY_wrap.cxx:2815: error[uninitvar]: Uninitialized variable: v
# 2813|       a[1] = (VALUE)(&v);
# 2814|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2815|->       if (val) *val = v;
# 2816|         return SWIG_OK;
# 2817|       }

Error: CPPCHECK_WARNING (CWE-476): [#def32]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:1662: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1660|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1661|     char *klass_name = (char *) malloc(klass_len);
# 1662|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1663|     if (NIL_P(_cSWIG_Pointer)) {
# 1664|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def33]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:1720: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1718|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1719|       klass_name = (char *) malloc(klass_len);
# 1720|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1721|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1722|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def34]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:3123: error[uninitvar]: Uninitialized variable: v
# 3121|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 3122|           return SWIG_OverflowError;
# 3123|->       if (val) *val = v;
# 3124|         return SWIG_OK;
# 3125|       }

Error: CPPCHECK_WARNING (CWE-457): [#def35]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:3169: error[uninitvar]: Uninitialized variable: v
# 3167|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 3168|           return SWIG_OverflowError;
# 3169|->       if (val) *val = v;
# 3170|         return SWIG_OK;
# 3171|       }

Error: CPPCHECK_WARNING (CWE-457): [#def36]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:3226: error[uninitvar]: Uninitialized variable: v
# 3224|       a[1] = (VALUE)(&v);
# 3225|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 3226|->       if (val) *val = v;
# 3227|         return SWIG_OK;
# 3228|       }

Error: CPPCHECK_WARNING (CWE-457): [#def37]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:3255: error[uninitvar]: Uninitialized variable: v
# 3253|       a[1] = (VALUE)(&v);
# 3254|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 3255|->       if (val) *val = v;
# 3256|         return SWIG_OK;
# 3257|       }

Error: CPPCHECK_WARNING (CWE-457): [#def38]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:13704: error[legacyUninitvar]: Uninitialized variable: arg2
#13702|     arg3 = static_cast< bool >(val3);
#13703|     try {
#13704|->     result = (libdnf5::comps::GroupQuery *)new libdnf5::comps::GroupQuery((libdnf5::BaseWeakPtr const &)*arg1,SWIG_STD_MOVE(arg2),arg3);
#13705|       DATA_PTR(self) = result;
#13706|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def39]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:13755: error[legacyUninitvar]: Uninitialized variable: arg2
#13753|     }
#13754|     try {
#13755|->     result = (libdnf5::comps::GroupQuery *)new libdnf5::comps::GroupQuery((libdnf5::BaseWeakPtr const &)*arg1,SWIG_STD_MOVE(arg2));
#13756|       DATA_PTR(self) = result;
#13757|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def40]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:13814: error[legacyUninitvar]: Uninitialized variable: arg2
#13812|     arg3 = static_cast< bool >(val3);
#13813|     try {
#13814|->     result = (libdnf5::comps::GroupQuery *)new libdnf5::comps::GroupQuery(*arg1,SWIG_STD_MOVE(arg2),arg3);
#13815|       DATA_PTR(self) = result;
#13816|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def41]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:13865: error[legacyUninitvar]: Uninitialized variable: arg2
#13863|     }
#13864|     try {
#13865|->     result = (libdnf5::comps::GroupQuery *)new libdnf5::comps::GroupQuery(*arg1,SWIG_STD_MOVE(arg2));
#13866|       DATA_PTR(self) = result;
#13867|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def42]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:18761: error[legacyUninitvar]: Uninitialized variable: arg2
#18759|     arg3 = static_cast< bool >(val3);
#18760|     try {
#18761|->     result = (libdnf5::comps::EnvironmentQuery *)new libdnf5::comps::EnvironmentQuery((libdnf5::BaseWeakPtr const &)*arg1,SWIG_STD_MOVE(arg2),arg3);
#18762|       DATA_PTR(self) = result;
#18763|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def43]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:18812: error[legacyUninitvar]: Uninitialized variable: arg2
#18810|     }
#18811|     try {
#18812|->     result = (libdnf5::comps::EnvironmentQuery *)new libdnf5::comps::EnvironmentQuery((libdnf5::BaseWeakPtr const &)*arg1,SWIG_STD_MOVE(arg2));
#18813|       DATA_PTR(self) = result;
#18814|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def44]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:18871: error[legacyUninitvar]: Uninitialized variable: arg2
#18869|     arg3 = static_cast< bool >(val3);
#18870|     try {
#18871|->     result = (libdnf5::comps::EnvironmentQuery *)new libdnf5::comps::EnvironmentQuery(*arg1,SWIG_STD_MOVE(arg2),arg3);
#18872|       DATA_PTR(self) = result;
#18873|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-457): [#def45]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_comps.dir/compsRUBY_wrap.cxx:18922: error[legacyUninitvar]: Uninitialized variable: arg2
#18920|     }
#18921|     try {
#18922|->     result = (libdnf5::comps::EnvironmentQuery *)new libdnf5::comps::EnvironmentQuery(*arg1,SWIG_STD_MOVE(arg2));
#18923|       DATA_PTR(self) = result;
#18924|     } catch(libdnf5::UserAssertionError &_e) {

Error: CPPCHECK_WARNING (CWE-476): [#def46]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_exception.dir/exceptionRUBY_wrap.cxx:1661: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1659|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1660|     char *klass_name = (char *) malloc(klass_len);
# 1661|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1662|     if (NIL_P(_cSWIG_Pointer)) {
# 1663|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def47]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_exception.dir/exceptionRUBY_wrap.cxx:1719: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1717|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1718|       klass_name = (char *) malloc(klass_len);
# 1719|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1720|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1721|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def48]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_exception.dir/exceptionRUBY_wrap.cxx:2212: error[uninitvar]: Uninitialized variable: v
# 2210|       a[1] = (VALUE)(&v);
# 2211|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2212|->       if (val) *val = v;
# 2213|         return SWIG_OK;
# 2214|       }

Error: CPPCHECK_WARNING (CWE-476): [#def49]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_logger.dir/loggerRUBY_wrap.cxx:1662: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1660|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1661|     char *klass_name = (char *) malloc(klass_len);
# 1662|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1663|     if (NIL_P(_cSWIG_Pointer)) {
# 1664|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def50]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_logger.dir/loggerRUBY_wrap.cxx:1720: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1718|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1719|       klass_name = (char *) malloc(klass_len);
# 1720|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1721|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1722|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def51]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_logger.dir/loggerRUBY_wrap.cxx:2574: error[uninitvar]: Uninitialized variable: v
# 2572|       a[1] = (VALUE)(&v);
# 2573|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2574|->       if (val) *val = v;
# 2575|         return SWIG_OK;
# 2576|       }

Error: CPPCHECK_WARNING (CWE-457): [#def52]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_logger.dir/loggerRUBY_wrap.cxx:2756: error[uninitvar]: Uninitialized variable: v
# 2754|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2755|           return SWIG_OverflowError;
# 2756|->       if (val) *val = v;
# 2757|         return SWIG_OK;
# 2758|       }

Error: CPPCHECK_WARNING (CWE-457): [#def53]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_logger.dir/loggerRUBY_wrap.cxx:2787: error[uninitvar]: Uninitialized variable: v
# 2785|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2786|           return SWIG_OverflowError;
# 2787|->       if (val) *val = v;
# 2788|         return SWIG_OK;
# 2789|       }

Error: CPPCHECK_WARNING (CWE-476): [#def54]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_plugin.dir/pluginRUBY_wrap.cxx:1662: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1660|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1661|     char *klass_name = (char *) malloc(klass_len);
# 1662|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1663|     if (NIL_P(_cSWIG_Pointer)) {
# 1664|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def55]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_plugin.dir/pluginRUBY_wrap.cxx:1720: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1718|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1719|       klass_name = (char *) malloc(klass_len);
# 1720|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1721|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1722|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def56]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_plugin.dir/pluginRUBY_wrap.cxx:2873: error[uninitvar]: Uninitialized variable: v
# 2871|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2872|           return SWIG_OverflowError;
# 2873|->       if (val) *val = v;
# 2874|         return SWIG_OK;
# 2875|       }

Error: CPPCHECK_WARNING (CWE-476): [#def57]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_transaction.dir/transactionRUBY_wrap.cxx:1661: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1659|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1660|     char *klass_name = (char *) malloc(klass_len);
# 1661|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1662|     if (NIL_P(_cSWIG_Pointer)) {
# 1663|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def58]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_transaction.dir/transactionRUBY_wrap.cxx:1719: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1717|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1718|       klass_name = (char *) malloc(klass_len);
# 1719|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1720|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1721|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def59]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_transaction.dir/transactionRUBY_wrap.cxx:2685: error[uninitvar]: Uninitialized variable: v
# 2683|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2684|           return SWIG_OverflowError;
# 2685|->       if (val) *val = v;
# 2686|         return SWIG_OK;
# 2687|       }

Error: CPPCHECK_WARNING (CWE-457): [#def60]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_transaction.dir/transactionRUBY_wrap.cxx:2731: error[uninitvar]: Uninitialized variable: v
# 2729|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2730|           return SWIG_OverflowError;
# 2731|->       if (val) *val = v;
# 2732|         return SWIG_OK;
# 2733|       }

Error: CPPCHECK_WARNING (CWE-457): [#def61]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_transaction.dir/transactionRUBY_wrap.cxx:2788: error[uninitvar]: Uninitialized variable: v
# 2786|       a[1] = (VALUE)(&v);
# 2787|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2788|->       if (val) *val = v;
# 2789|         return SWIG_OK;
# 2790|       }

Error: CPPCHECK_WARNING (CWE-457): [#def62]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_transaction.dir/transactionRUBY_wrap.cxx:2817: error[uninitvar]: Uninitialized variable: v
# 2815|       a[1] = (VALUE)(&v);
# 2816|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2817|->       if (val) *val = v;
# 2818|         return SWIG_OK;
# 2819|       }

Error: CPPCHECK_WARNING (CWE-476): [#def63]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_utils.dir/utilsRUBY_wrap.cxx:1661: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1659|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1660|     char *klass_name = (char *) malloc(klass_len);
# 1661|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1662|     if (NIL_P(_cSWIG_Pointer)) {
# 1663|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def64]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5/CMakeFiles/ruby_utils.dir/utilsRUBY_wrap.cxx:1719: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1717|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1718|       klass_name = (char *) malloc(klass_len);
# 1719|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1720|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1721|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-476): [#def65]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5_cli/CMakeFiles/ruby_progressbar.dir/progressbarRUBY_wrap.cxx:1661: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1659|     size_t klass_len = 4 + strlen(type->name) + 1;
# 1660|     char *klass_name = (char *) malloc(klass_len);
# 1661|->   SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1662|     if (NIL_P(_cSWIG_Pointer)) {
# 1663|       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);

Error: CPPCHECK_WARNING (CWE-476): [#def66]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5_cli/CMakeFiles/ruby_progressbar.dir/progressbarRUBY_wrap.cxx:1719: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: klass_name
# 1717|       size_t klass_len = 4 + strlen(type->name) + 1;
# 1718|       klass_name = (char *) malloc(klass_len);
# 1719|->     SWIG_snprintf(klass_name, klass_len, "TYPE%s", type->name);
# 1720|       klass = rb_const_get(_mSWIG, rb_intern(klass_name));
# 1721|       free((void *) klass_name);

Error: CPPCHECK_WARNING (CWE-457): [#def67]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5_cli/CMakeFiles/ruby_progressbar.dir/progressbarRUBY_wrap.cxx:2144: error[uninitvar]: Uninitialized variable: v
# 2142|       a[1] = (VALUE)(&v);
# 2143|       if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
# 2144|->       if (val) *val = v;
# 2145|         return SWIG_OK;
# 2146|       }

Error: CPPCHECK_WARNING (CWE-457): [#def68]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5_cli/CMakeFiles/ruby_progressbar.dir/progressbarRUBY_wrap.cxx:2353: error[uninitvar]: Uninitialized variable: v
# 2351|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2352|           return SWIG_OverflowError;
# 2353|->       if (val) *val = v;
# 2354|         return SWIG_OK;
# 2355|       }

Error: CPPCHECK_WARNING (CWE-457): [#def69]
dnf5-5.2.17.0/redhat-linux-build/bindings/ruby/libdnf5_cli/CMakeFiles/ruby_progressbar.dir/progressbarRUBY_wrap.cxx:2384: error[uninitvar]: Uninitialized variable: v
# 2382|         if (rb_funcall(obj, swig_lowerthan_id, 1, INT2FIX(0)) != Qfalse)
# 2383|           return SWIG_OverflowError;
# 2384|->       if (val) *val = v;
# 2385|         return SWIG_OK;
# 2386|       }

Error: CPPCHECK_WARNING (CWE-416): [#def70]
dnf5-5.2.17.0/test/libdnf5-cli/output/test_repoquery.cpp:52: error[deallocuse]: Dereferencing 'stream' after it is deallocated / released
#   50|   
#   51|       ~MemStream() {
#   52|->         CPPUNIT_ASSERT_EQUAL(fclose(stream), 0);
#   53|           free(buf);
#   54|       }

Error: CPPCHECK_WARNING (CWE-416): [#def71]
dnf5-5.2.17.0/test/libdnf5/utils/test_fs.cpp:394: error[deallocuse]: Dereferencing 'file_p' after it is deallocated / released
#  392|       CPPUNIT_ASSERT_EQUAL((size_t)10, res);  // in theory, the read() could read less and this would fail
#  393|       CPPUNIT_ASSERT_EQUAL(data_w, std::string(data_r, sizeof(data_r)));
#  394|->     CPPUNIT_ASSERT_EQUAL(0, std::fclose(file_p));
#  395|   }
#  396|   

Error: CPPCHECK_WARNING (CWE-562): [#def72]
dnf5-5.2.17.0/test/libdnf5/weak_ptr/test_weak_ptr.cpp:70: error[danglingTemporaryLifetime]: Using object that is a temporary.
#   68|   
#   69|       // test access to data managed by WeakPtr (by get() and operator ->)
#   70|->     CPPUNIT_ASSERT(*item1_weak_ptr.get() == "sack1_item1");
#   71|       CPPUNIT_ASSERT(item2_weak_ptr->compare("sack1_item2") == 0);
#   72|       CPPUNIT_ASSERT(*item3_weak_ptr.get() == "sack2_item1");

Error: CPPCHECK_WARNING (CWE-562): [#def73]
dnf5-5.2.17.0/test/libdnf5/weak_ptr/test_weak_ptr.cpp:71: error[danglingTemporaryLifetime]: Using object that is a temporary.
#   69|       // test access to data managed by WeakPtr (by get() and operator ->)
#   70|       CPPUNIT_ASSERT(*item1_weak_ptr.get() == "sack1_item1");
#   71|->     CPPUNIT_ASSERT(item2_weak_ptr->compare("sack1_item2") == 0);
#   72|       CPPUNIT_ASSERT(*item3_weak_ptr.get() == "sack2_item1");
#   73|       CPPUNIT_ASSERT(item4_weak_ptr->compare("sack2_item2") == 0);

Error: CPPCHECK_WARNING (CWE-562): [#def74]
dnf5-5.2.17.0/test/libdnf5/weak_ptr/test_weak_ptr.cpp:72: error[danglingTemporaryLifetime]: Using object that is a temporary.
#   70|       CPPUNIT_ASSERT(*item1_weak_ptr.get() == "sack1_item1");
#   71|       CPPUNIT_ASSERT(item2_weak_ptr->compare("sack1_item2") == 0);
#   72|->     CPPUNIT_ASSERT(*item3_weak_ptr.get() == "sack2_item1");
#   73|       CPPUNIT_ASSERT(item4_weak_ptr->compare("sack2_item2") == 0);
#   74|   

Error: CPPCHECK_WARNING (CWE-562): [#def75]
dnf5-5.2.17.0/test/libdnf5/weak_ptr/test_weak_ptr.cpp:73: error[danglingTemporaryLifetime]: Using object that is a temporary.
#   71|       CPPUNIT_ASSERT(item2_weak_ptr->compare("sack1_item2") == 0);
#   72|       CPPUNIT_ASSERT(*item3_weak_ptr.get() == "sack2_item1");
#   73|->     CPPUNIT_ASSERT(item4_weak_ptr->compare("sack2_item2") == 0);
#   74|   
#   75|       // test hase_same_guard() method

Error: CPPCHECK_WARNING (CWE-398): [#def76]
dnf5-5.2.17.0/test/shared/base_test_case.cpp:112: warning[containerOutOfBounds]: Either the condition 'found.empty()' is redundant or expression 'found.begin()' causes access out of bounds.
#  110|       }
#  111|   
#  112|->     return *found.begin();
#  113|   }
#  114|   

Error: CPPCHECK_WARNING (CWE-398): [#def77]
dnf5-5.2.17.0/test/shared/base_test_case.cpp:133: warning[containerOutOfBounds]: Either the condition 'found.empty()' is redundant or expression 'found.begin()' causes access out of bounds.
#  131|       }
#  132|   
#  133|->     return *found.begin();
#  134|   }
#  135|   

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-29.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-gcc-latest-x86_64
project-namednf5-5.2.17.0-2.fc44
store-results-to/tmp/tmp888nq9p1/dnf5-5.2.17.0-2.fc44.tar.xz
time-created2025-10-28 17:59:43
time-finished2025-10-28 18:14:51
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp888nq9p1/dnf5-5.2.17.0-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp888nq9p1/dnf5-5.2.17.0-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9