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 MultibyteIncrementalEncoderObject
  • Loading branch information
picnixz committed Jan 20, 2025
commit a9fe4985c9b82b11aee92c260856d8d02b952687
7 changes: 4 additions & 3 deletions Modules/cjkcodecs/multibytecodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,17 +1108,18 @@ mbiencoder_init(PyObject *self, PyObject *args, PyObject *kwds)
}

static int
mbiencoder_traverse(MultibyteIncrementalEncoderObject *self,
visitproc visit, void *arg)
mbiencoder_traverse(PyObject *op, visitproc visit, void *arg)
{
MultibyteIncrementalEncoderObject *self = _MultibyteIncrementalEncoderObject_CAST(op);
if (ERROR_ISCUSTOM(self->errors))
Py_VISIT(self->errors);
return 0;
}

static void
mbiencoder_dealloc(MultibyteIncrementalEncoderObject *self)
mbiencoder_dealloc(PyObject *op)
{
MultibyteIncrementalEncoderObject *self = _MultibyteIncrementalEncoderObject_CAST(op);
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);
ERROR_DECREF(self->errors);
Expand Down
0