From 350b2c64e053a9963eadf67f844090c7ea2845c7 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 26 Aug 2013 07:17:02 -0400 Subject: [PATCH] Fixed nasty crash during PE's Cocoa block scanning Using PyUnicode_GET_SIZE was obviously wrong, but I'm guessing that the str changes in py3.3 made that wrongness significant... --- core_pe/modules/block_osx.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core_pe/modules/block_osx.m b/core_pe/modules/block_osx.m index d585794b..f4280dae 100644 --- a/core_pe/modules/block_osx.m +++ b/core_pe/modules/block_osx.m @@ -32,7 +32,7 @@ pystring2cfstring(PyObject *pystring) } s = (UInt8*)PyBytes_AS_STRING(encoded); - size = PyUnicode_GET_SIZE(encoded); + size = PyBytes_GET_SIZE(encoded); result = CFStringCreateWithBytes(NULL, s, size, kCFStringEncodingUTF8, FALSE); Py_DECREF(encoded); return result;