8000 gh-111178: fix UBSan failures in `Modules/cjkcodecs/multibytecodec.c` by picnixz · Pull Request #129090 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111178: fix UBSan failures in Modules/cjkcodecs/multibytecodec.c #129090

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

Merged
merged 9 commits into from
Jan 25, 2025
Prev Previous commit
Next Next commit
fix UBSan failures for MultibyteStreamWriterObject
  • Loading branch information
picnixz committed Jan 20, 2025
commit 0c6d52b154f3413643ae6cb0713c5b6fa9a918ba
7 changes: 4 additions & 3 deletions Modules/cjkcodecs/multibytecodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,18 +1932,19 @@ mbstreamwriter_init(PyObject *self, PyObject *args, PyObject *kwds)
}

static int
mbstreamwriter_traverse(MultibyteStreamWriterObject *self,
visitproc visit, void *arg)
mbstreamwriter_traverse(PyObject *op, visitproc visit, void *arg)
{
MultibyteStreamWriterObject *self = _MultibyteStreamWriterObject_CAST(op);
if (ERROR_ISCUSTOM(self->errors))
Py_VISIT(self->errors);
Py_VISIT(self->stream);
return 0;
}

static void
mbstreamwriter_dealloc(MultibyteStreamWriterObject *self)
mbstreamwriter_dealloc(PyObject *op)
{
MultibyteStreamWriterObject *self = _MultibyteStreamWriterObject_CAST(op);
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);
ERROR_DECREF(self->errors);
Expand Down
0