Bug 1870557

Summary: invalid free in SWIG_Python_AddErrMesg
Product: Red Hat Enterprise Linux 8 Reporter: Jaroslav Rohel <jrohel>
Component: swigAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED ERRATA QA Contact: Jakub Heger <jheger>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: bnater, jorton, jplesnik
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:20:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Rohel 2020-08-20 11:05:58 UTC
Description of problem:
I investigated covscan results of libdnf and there was a message:
incorrect_free: "free" frees incorrect pointer "(void *)tmp".
#  2856|   	PyErr_Format(type, "%s %s", tmp, mesg);
#  2857|         }
#  2858|->       SWIG_Python_str_DelForPy3(tmp);
#  2859|         Py_DECREF(old_str);
#  2860|       }

There is a bug in SWIG.
I found that the bug was fixed 2 years ago https://github.com/swig/swig/commit/142d4062df56aa3a6dd74b06e86700d95421b774 .

Actual results:
Buggy code generated.

Expected results:
Fixed SWIG (upgrade/backported patch).

Comment 1 Jitka Plesnikova 2020-08-20 12:25:23 UTC
Thank you for the report. 

I am preparing SWIG 4, which contains the fix, for RHEL 8.4.

Comment 13 errata-xmlrpc 2021-05-18 15:20:26 UTC
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 (new module: swig:4.0), 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/RHEA-2021:1755