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...
This commit is contained in:
Virgil Dupras 2013-08-26 07:17:02 -04:00
parent dcc57a7afb
commit 350b2c64e0
1 changed files with 1 additions and 1 deletions

View File

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