-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-103987: fix crash in mmap module #103990
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
Changes from 1 commit
d5cf0dd
af99baa
6b7af10
6ab6a70
50cc20b
4d26d53
d8a1365
428338f
0a8213f
b460efe
55bd26e
7adecc4
caab85b
d8b9897
6d50192
3784382
5e19249
b0d1fcd
1482ee7
8c76209
2018297
2cea232
e0de742
5389a41
b5e37d7
ed1715e
49d1094
61cdd6e
5c8d709
341b90a
6dece9f
5cf8f90
93163d9
3b61c74
f2d2d00
843c2eb
168f5b1
435ed41
320feac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -954,6 +954,7 @@ mmap_subscript(mmap_object *self, PyObject *item) | |
if (PySlice_Unpack(item, &start, &stop, &step) < 0) { | ||
return NULL; | ||
} | ||
CHECK_VALID(NULL); | ||
slicelen = PySlice_AdjustIndices(self->size, &start, &stop, step); | ||
|
||
if (slicelen <= 0) | ||
|
@@ -969,6 +970,8 @@ mmap_subscript(mmap_object *self, PyObject *item) | |
|
||
if (result_buf == NULL) | ||
return PyErr_NoMemory(); | ||
CHECK_VALID(NULL); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could the buffer have been invalidated here as a side effect of the PyMem_Malloc call above triggering GC? I seem to recall that's possible, but not 100% sure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot find any GC-related code in |
||
for (cur = start, i = 0; i < slicelen; | ||
cur += step, i++) { | ||
result_buf[i] = self->data[cur]; | ||
|
Uh oh!
There was an error while loading. Please reload this page.