[Forensics-changes] [yara] 104/160: Fix bug while writing to streams in Python 3.x

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:23 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 d11a68270a4ddcae3e47e65b587f8f54a7228499
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue May 5 14:43:34 2015 +0200

    Fix bug while writing to streams in Python 3.x
---
 yara-python/yara-python.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/yara-python/yara-python.c b/yara-python/yara-python.c
index 4ae353f..c62518f 100644
--- a/yara-python/yara-python.c
+++ b/yara-python/yara-python.c
@@ -654,7 +654,11 @@ static size_t flo_write(
     PyGILState_STATE gil_state = PyGILState_Ensure();
 
     PyObject* result = PyObject_CallMethod(
-        (PyObject*) user_data, "write", "s#", (char*) ptr + i * size, size);
+    #if PY_MAJOR_VERSION >= 3
+        (PyObject*) user_data, "write", "y#", ptr + i * size, size);
+    #else
+        (PyObject*) user_data, "write", "s#", ptr + i * size, size);
+    #endif
 
     PyGILState_Release(gil_state);
 

-- 
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