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
c57e97df
Unverified
Commit
c57e97df
authored
Apr 23, 2020
by
Victor M. Alvarez
Committed by
GitHub
Apr 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #136 for Python 2.7 too. (#140)
parent
bc4e0cdb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
tests.py
tests.py
+3
-3
yara
yara
+1
-1
yara-python.c
yara-python.c
+1
-1
No files found.
tests.py
View file @
c57e97df
...
...
@@ -695,13 +695,13 @@ class TestYara(unittest.TestCase):
def
testMeta
(
self
):
r
=
yara
.
compile
(
source
=
r'rule test { meta: a = "foo\x80bar" condition: true }'
)
self
.
assertTrue
(
list
(
r
)[
0
]
.
meta
[
'a'
]
==
'foobar'
)
self
.
assertTrue
(
(
list
(
r
)[
0
]
.
meta
[
'a'
])
==
'foobar'
)
# This test ensures that anything after the NULL character is stripped.
def
testMetaNull
(
self
):
r
=
yara
.
compile
(
source
=
r'rule test { meta: a = "foo\x00bar\x80" condition: true }'
)
self
.
assertTrue
(
list
(
r
)[
0
]
.
meta
[
'a'
]
==
'foo'
)
self
.
assertTrue
(
(
list
(
r
)[
0
]
.
meta
[
'a'
])
==
'foo'
)
# This test is similar to testMeta but it tests the meta data generated
# when a Match object is created.
...
...
@@ -709,7 +709,7 @@ class TestYara(unittest.TestCase):
r
=
yara
.
compile
(
source
=
r'rule test { meta: a = "foo\x80bar" condition: true }'
)
m
=
r
.
match
(
data
=
'dummy'
)
self
.
assertTrue
(
list
(
m
)[
0
]
.
meta
[
'a'
]
==
'foobar'
)
self
.
assertTrue
(
(
list
(
m
)[
0
]
.
meta
[
'a'
])
==
'foobar'
)
def
testFilesize
(
self
):
...
...
yara
@
b15d6bb0
Subproject commit
60034b7e1929695c86a541a224e579ff8b79f75c
Subproject commit
b15d6bb0568fc77923e6149322e6d63a8b2007b6
yara-python.c
View file @
c57e97df
...
...
@@ -50,7 +50,7 @@ typedef long Py_hash_t;
#define PY_STRING_TO_C(x) PyUnicode_AsUTF8(x)
#define PY_STRING_CHECK(x) PyUnicode_Check(x)
#else
#define PY_STRING(x) PyString_
FromString(x
)
#define PY_STRING(x) PyString_
Decode(x, strlen(x), "utf-8", "ignore"
)
#define PY_STRING_TO_C(x) PyString_AsString(x)
#define PY_STRING_CHECK(x) (PyString_Check(x) || PyUnicode_Check(x))
#endif
...
...
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