[Rpm-maint] [rpm-software-management/rpm] Handle missing closing paren in %attr rules (#1649)

Jeff Mahoney notifications at github.com
Wed Apr 21 20:35:14 UTC 2021


parseForAttr is missing the check for the closing paren.  When a malformed
rule is encountered, the bounds for the end of the rule will be the NUL
terminator for the string.  When it overwrites the rule with spaces,
the entire string, including the NUL terminator, will be overwritten.

Later, in parseForSimple, the string will no longer contain a pathname and
will fail the check for files beginning with /.  Since the string is also
no longer NUL terminated, the error will contain garbage like the following:

error: File must begin with "/": nÔLó_;^?

Adding the check for the closing paren fixes the issue.

Fixes: #1648
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1649

-- Commit Summary --

  * Handle missing closing paren in %attr rules

-- File Changes --

    M build/files.c (5)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1649.patch
https://github.com/rpm-software-management/rpm/pull/1649.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1649
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210421/59e2dff6/attachment.html>


More information about the Rpm-maint mailing list