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
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to