[Rpm-maint] [rpm-software-management/rpm] Fix logic error in macro file reader (#1606)

Michael Schroeder notifications at github.com
Fri Mar 26 11:14:33 UTC 2021


The old logic always finished adding lines if an empty line
was encountered, because the check that should guard against
accessing outside of the read buffer was done at the wrong
level.

Also simplify the code by letting 'q' point to the new line and
not before the newline, which also fixes potential undefined
behaviour.

Also get rid of the unused 'nread' variable.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Fix logic error in macro file reader

-- File Changes --

    M rpmio/macro.c (20)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1606.patch
https://github.com/rpm-software-management/rpm/pull/1606.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/1606
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210326/ead7de65/attachment-0001.html>


More information about the Rpm-maint mailing list