Merged #844 into master.
--
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/844#event-2643132460___
Rpm-maint mailing list
@pmatilai pushed 1 commit.
df5d5b712b6210702c5b399f716780331b5a8b47 Trap division by zero in expression
parser
--
You are receiving this because you are subscribed to this thread.
View it on GitHub:
pmatilai commented on this pull request.
> @@ -438,6 +438,10 @@ static Value doMultiplyDivide(ParseState state)
if (valueIsInteger(v1)) {
int i1 = v1->data.i, i2 = v2->data.i;
+ if ((i2 == 0) && (TOK_DIVIDE)) {
Ugh, yeah:
```
$ ./rpm --eval "%{expr:1*0}"
error: division by
mlschroe commented on this pull request.
> @@ -438,6 +438,10 @@ static Value doMultiplyDivide(ParseState state)
if (valueIsInteger(v1)) {
int i1 = v1->data.i, i2 = v2->data.i;
+ if ((i2 == 0) && (TOK_DIVIDE)) {
Is `(TOK_DIVIDE)` supposed to be `(op == TOK_DIVIDE)`?
--
You
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/844
-- Commit Summary --
* Trap division by zero in expression parser
-- File Changes --
M rpmio/expression.c (4)
M tests/rpmmacro.at (2)
-- Patch Links --