Commit 2daffa60 by Victor M. Alvarez

Update yara submodule and disable includes by calling yr_compiler_set_include_callback with NULL.

parent b68d85f5
......@@ -755,6 +755,9 @@ class TestYara(unittest.TestCase):
r = yara.compile(p2)
self.assertTrue(len(r.match(data='dummy')) == 2)
with self.assertRaises(yara.SyntaxError):
yara.compile(source='include "test"', includes=False)
def testExternals(self):
r = yara.compile(source='rule test { condition: ext_int == 15 }', externals={'ext_int': 15})
......
Subproject commit a33ab375471865225b41299d14a4083942c852ff
Subproject commit 80874eba1c9358647c6e25eb84ea50cf594f9ef1
......@@ -1781,7 +1781,8 @@ static PyObject* yara_compile(
if (PyBool_Check(includes))
{
// PyObject_IsTrue can return -1 in case of error
compiler->allow_includes = (PyObject_IsTrue(includes) == 1);
if (PyObject_IsTrue(includes) == 1)
yr_compiler_set_include_callback(compiler, NULL, NULL, NULL);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment