Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpm: Reset RPM log callback upon RpmLogGuard destruction
This patch addresses undefined behavior that occurs when the RPM log callback function is invoked after the RpmLogGuard object has been destroyed. The issue arises because rpmlogCallbackData retains a reference to the destroyed object. The problem manifests during the execution of the builddep plugin command: 1. During Vars::detect_release, the RPM log callback is set via RpmLogGuard. 2. After the release version is detected, the RpmLogGuard object is destroyed. 3. A subsequent call to rpmSpecParse() by the builddep command may trigger the previously set log callback. 4. This results in undefined behavior because the callback data still points to the destroyed RpmLogGuard. By resetting the RPM log callback upon RpmLogGuard destruction, this patch ensures safe and predictable behavior. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2326535 Resolves: #1864
- Loading branch information