We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4669b24 commit 3dbc815Copy full SHA for 3dbc815
graalpython/com.oracle.graal.python.cext/src/capi.c
@@ -266,7 +266,7 @@ const char* PyTruffle_StringToCstr(void* o, int32_t strLen) {
266
const char* PyTruffle_ByteArrayToNative(const void* jbyteArray, int len) {
267
int i;
268
int size = len != 0 ? len : 1;
269
- char* barr = (const char*) malloc(len * sizeof(char));
+ char* barr = (const char*) malloc(size * sizeof(char));
270
barr[0] = '\0';
271
for(i=0; i < len; i++) {
272
barr[i] = (char) polyglot_get_array_element(jbyteArray, i);
0 commit comments