[Forensics-changes] [yara] 21/160: Fix issue with "save" function not accepting unicode strings in Python 2.x

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.4.0
in repository yara.

commit 4203961c77e69e10ed751664ed83c28e7b915f40
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Mon Feb 16 13:14:33 2015 +0100

    Fix issue with "save" function not accepting unicode strings in Python 2.x
    
    This fix also affects external variables, now unicode strings can be passed as values for external variables.
---
 yara-python/yara-python.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/yara-python/yara-python.c b/yara-python/yara-python.c
index e045518..df687f0 100644
--- a/yara-python/yara-python.c
+++ b/yara-python/yara-python.c
@@ -47,7 +47,7 @@ typedef int Py_ssize_t;
 #else
 #define PY_STRING(x) PyString_FromString(x)
 #define PY_STRING_TO_C(x) PyString_AsString(x)
-#define PY_STRING_CHECK(x) PyString_Check(x)
+#define PY_STRING_CHECK(x) (PyString_Check(x) || PyUnicode_Check(x))
 #endif
 
 /* Module globals */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list