Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For expression allows negative count #241

Open
MatejKastak opened this issue Mar 10, 2023 · 0 comments
Open

For expression allows negative count #241

MatejKastak opened this issue Mar 10, 2023 · 0 comments
Labels
bug C-parser mirrored Issue is mirrored in butr

Comments

@MatejKastak
Copy link
Member

Expressions like this are not valid, but we allow them:

for -1 i in (0 .. 1) : (true)
for -1 i in (0 .. 1): (true)
for -123 i in (0 .. 1): (true)
rule test {
    condition:
        for -1 i in (0): (true)
}
env λ ~/dev/yara/yara for.yar /dev/null
error: rule "test" in for.yar(3): invalid value in condition: "-1"
>>> ymod.parse_string('''rule test {
...     condition:
...         for -1 i in (0): (true)
... }
... ''')
<yaramod.YaraFile object at 0x7f4cebab9070>

Definition of done: Yaramod won't parse the negative numbers, which is the same behavior as current YARA parser.

@MatejKastak MatejKastak added bug C-parser mirrored Issue is mirrored in butr labels Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug C-parser mirrored Issue is mirrored in butr
Projects
None yet
Development

No branches or pull requests

1 participant