Description of problem: Calling str() on empty DictStr object triggers a segfault. Version-Release number of selected component (if applicable): $ sudo dnf list installed | grep libcomps libcomps.x86_64 0.1.11-1.fc30 @anaconda libcomps-devel.x86_64 0.1.11-1.fc30 @fedora python3-libcomps.x86_64 0.1.11-1.fc30 @anaconda How reproducible: The following python script will reproduce the problem consistently: import libcomps import urllib.request url_empty_strdict = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-unsigned/repodata/5e655c4cde94fe5f1a39ed2015d5a5bbfa051fa032b3fb911609ada337b5fee8-comps.xml' url_non_empty_strdict = 'https://dl.fedoraproject.org/pub/epel/7/x86_64/repodata/c629c8fc439517aed1ff09d9c8ba32f2fa6984a2f9683e4cd19726591f68128b-comps-Everything.x86_64.xml' def test(url): file_path = '/tmp/test_comps.xml' urllib.request.urlretrieve(url, file_path) comps = libcomps.Comps() comps.fromxml_f(file_path) print(comps.categories[0].desc_by_lang) test(url_empty_strdict) # segfault #test(url_non_empty_strdict) # no segfault Steps to Reproduce: See above Actual results: segfault Expected results: no segfault Additional info: We are using the python bindings so not sure if it extends beyond that. Opened an issue on Github as well: https://github.com/rpm-software-management/libcomps/issues/54
I created a PR that should fix this: https://github.com/rpm-software-management/libcomps/pull/56 It also contains a commit with some simple test.
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. https://access.redhat.com/errata/RHBA-2020:1854