eyad-hazem-elmorsy commented on code in PR #3429:
URL: https://github.com/apache/fory/pull/3429#discussion_r2867925533
##########
python/pyfory/buffer.pyx:
##########
@@ -283,8 +283,10 @@ cdef class Buffer:
if length > 0:
self.c_buffer.write_bytes(&data[0], length)
- cpdef inline bytes read_bytes_and_size(self):
+ cpdef inline bytes read_bytes_and_size(self, int32_t max_binary_size=-1):
Review Comment:
Looks good, but I want to ask about the line I mentioned before:
`cdef bytes py_bytes = PyBytes_FromStringAndSize(NULL, length)` in buffer
`read_bytes` function
I searched and found that this call may result OOM crash or Memory Error
before any checks.
So we can check bounds or ensure readability first. What do you see?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]