Here is the patch https://github.com/rpm-software-management/libdnf/pull/756. Just for QE - it fixes the crash in allocation of memory.
I don't believe that this is testable. The reproducer requires probably very specific repository that use includepkgs.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.