Message145319
The condition contradicts the exception text:
if (offset >= st.st_size) {
PyErr_SetString(PyExc_ValueError,
"mmap offset is greater than file size");
return NULL;
}
The condition should be changed to (offset > st.st_size), similar to the later condition which is correct:
} else if (offset + (size_t)map_size > st.st_size) {
PyErr_SetString(PyExc_ValueError,
"mmap length is greater than file size");
return NULL;
}
The patch is attached. |
|
Date |
User |
Action |
Args |
2011-10-11 00:45:48 | jazzer | set | recipients:
+ jazzer |
2011-10-11 00:45:48 | jazzer | set | messageid: <1318293948.21.0.819256952944.issue13148@psf.upfronthosting.co.za> |
2011-10-11 00:45:47 | jazzer | link | issue13148 messages |
2011-10-11 00:45:47 | jazzer | create | |
|