freeArgs() only popped any local macros once, so if a local macro was pushed multiple times, whether through %define or multiple identical options getting passed, we leaked any remaining macros to the outside scope.
Simply pop the local macros in a loop to fix. Have the internal popMacro() return the previous pointer (if any) to simplify the job. We even had an expected-fail test for this, which now passes. This bug was circa 26 years old. Some might call it vintage at this point. Fixes: #3056 You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/3059 -- Commit Summary -- * Fix multiply defined local macros escaping scope -- File Changes -- M rpmio/macro.c (19) M tests/rpmmacro.at (1) -- Patch Links -- https://github.com/rpm-software-management/rpm/pull/3059.patch https://github.com/rpm-software-management/rpm/pull/3059.diff -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3059 You are receiving this because you are subscribed to this thread. Message ID: <rpm-software-management/rpm/pull/3...@github.com>
_______________________________________________ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint