| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
|
|
||
| // gh-143007: PyNumber_Long can call arbitrary code through __int__ | ||
| // which may detach the underlying buffer. | ||
| if (self->detached) { |
There was a problem hiding this comment.
I think this isn't the right place to add the check, the _PyFile_Flush just before this could result in the same issue, and the cookie's buffer / decoding into it isn't what actually breaks (the buffer in this function is locally allocated, the cookie should be valid the whole time of this function).
I think this should do a CHECK_ATTACHED like check just before the res = PyObject_CallMethodOneArg(self->buffer, &_Py_ID(seek), posobj); as that's what is doing the self->buffer usage/call/dereference.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes but it is my first solution
an rethink that we can forget add in the future in other place
CHECK_ATTACHED and check it in the middle of the code is not match its name
Sorry, something went wrong.
There was a problem hiding this comment.
changed back to the first way as you suggestion thank you
Sorry, something went wrong.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
…/cpython into hy/close_issue_143007
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
this patch fix crash .TextIOWrapper.seek with a custom int method detaches
add textiowrapper_parse_cookie instead of check detect again to make the code clear