I wrote a simple Android native function that get a filename and some more arguments and read the file by mmapping (mmap) it\'s memory.
Because it\'s mmap, I don\'t real
The while
loop is infinite:
while(ret_val == buffer || read_length
as memcpy() always returns the desintation buffer so ret_val == buffer
will always be true
(and is therefore useless as part of the terminating condition). This means that addr
is being incremented by jbuffer_size
bytes on every iteration of the loop and is passed to memcpy()
, resuting in accessing invalid memory.