[Rpm-maint] [rpm-software-management/rpm] Fix multiply defined local macros escaping scope (PR #3059)

Panu Matilainen notifications at github.com
Wed Apr 24 07:32:18 UTC 2024


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/3059 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240424/57f8c9c6/attachment-0001.html>


More information about the Rpm-maint mailing list