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

Percentages allow non-integer types #253

Open
vojone opened this issue Jul 25, 2023 · 0 comments
Open

Percentages allow non-integer types #253

vojone opened this issue Jul 25, 2023 · 0 comments

Comments

@vojone
Copy link
Contributor

vojone commented Jul 25, 2023

I noticed, that rules like:

rule bad_type_percentage {
        strings:
                $s = "test"
        condition:
                "test"% of them
}

Result in error:

error: rule "bad_type_percentage" in test.yar(5): wrong type "string" for % operator

But when I execute this python code:

import yaramod

y = yaramod.Yaramod()
yara_file = y.parse_string(r'''
rule bad_type_percentage {
        strings:
                $s = "test"
        condition:
                "test"% of them
}
''')

print(yara_file.text)

No exception is raised by yaramod. Shouldn't yaramod also test the data type of the expression before the percentage (%) operator?

@vojone vojone changed the title Percentage allows non-integer types Percentages allow non-integer types Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant