-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for byte-like objects as input value in pybddisasm. #20
Conversation
return view->buf; | ||
} | ||
|
||
buffer = (char *)malloc(sizeof(char) * view->len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is sizeof(char) really necessary?
pybddisasm/_pybddisasm/_pybddisasm.c
Outdated
@@ -967,18 +967,60 @@ static uint8_t _pybddisasm_py_stack_to_disasm(uint8_t stack) | |||
} | |||
|
|||
|
|||
static char * _pybddisasm_get_contiguous_buffer(Py_buffer *view) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The * should be placed near the function name.
pybddisasm/_pybddisasm/_pybddisasm.c
Outdated
if (PyBuffer_ToContiguous(buffer, view, view->len, 'C') < 0) | ||
{ | ||
PyErr_SetString(PyExc_ValueError, "PyBuffer_ToContiguous failed!"); | ||
free (buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space after free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some coding style comments only.
No description provided.