Segmentation fault on accessing const char *send_data in static PyObject *frame_data(PyObject *self, PyObject *args)
static PyObject *frame_data(PyObject *self, PyObject *args) and static PyObject *get_data(PyObject *self, PyObject *args) both declare a const char* array which PyArg_ParseTuple is supposed to populate. The behavior seems undefined as this works on my windows computer, but not on the mac.
Allocating a size for the c arrays fixes the issue, f.ex:
const char send_data[255]; instead of const char *send_data
I got it working correctly on both arm mac and windows by using the safer specifer z#, instead of s# in
if (!PyArg_ParseTuple(args, "z#|II", &send_data, &data_length, &frame_type, &seq_no)) and
if (!PyArg_ParseTuple(args, "z#", &frame_data, &buf_length))
using Py_ssize_t for buf_length/data_length
z# actually allocates the memory if i understood it correctly, while s# does not.