Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yara-python
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
yara-python
Commits
df5ea5b8
Commit
df5ea5b8
authored
5 years ago
by
kevin-haynie
Committed by
Victor M. Alvarez
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added max_match_data to set_config (#121)
parent
b9b3d247
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
yara-python.c
yara-python.c
+16
-4
No files found.
yara-python.c
View file @
df5ea5b8
...
...
@@ -1837,20 +1837,22 @@ static PyObject* yara_set_config(
* options present in yara/libyara.c yr_set_configuration(...) - ck
*/
static
char
*
kwlist
[]
=
{
"stack_size"
,
"max_strings_per_rule"
,
NULL
};
"stack_size"
,
"max_strings_per_rule"
,
"max_match_data"
,
NULL
};
unsigned
int
stack_size
=
0
;
unsigned
int
max_strings_per_rule
=
0
;
unsigned
int
max_match_data
=
0
;
int
error
=
0
;
if
(
PyArg_ParseTupleAndKeywords
(
args
,
keywords
,
"|II"
,
"|II
I
"
,
kwlist
,
&
stack_size
,
&
max_strings_per_rule
))
&
max_strings_per_rule
,
&
max_match_data
))
{
if
(
stack_size
!=
0
)
{
...
...
@@ -1871,6 +1873,16 @@ static PyObject* yara_set_config(
if
(
error
!=
ERROR_SUCCESS
)
return
handle_error
(
error
,
NULL
);
}
if
(
max_match_data
!=
0
)
{
error
=
yr_set_configuration
(
YR_CONFIG_MAX_MATCH_DATA
,
&
max_match_data
);
if
(
error
!=
ERROR_SUCCESS
)
return
handle_error
(
error
,
NULL
);
}
}
Py_RETURN_NONE
;
...
...
@@ -2309,7 +2321,7 @@ static PyMethodDef yara_methods[] = {
"set_config"
,
(
PyCFunction
)
yara_set_config
,
METH_VARARGS
|
METH_KEYWORDS
,
"Set a yara configuration variable (stack_size
or max_strings_per_rule
)"
"Set a yara configuration variable (stack_size
, max_strings_per_rule, or max_match_data
)"
},
{
NULL
,
NULL
}
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment