diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-07-16 20:17:31 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-07-16 20:17:31 (GMT) |
commit | 579db160b392404b6dd9608ce5f5bef29a9885a4 (patch) | |
tree | 453ae087910ea944efe5eed000d99c5d277e4cbe /Modules/cjkcodecs | |
parent | b37f43f94b693468d8b3b9dfc84b1930c52a1b61 (diff) | |
download | cpython-579db160b392404b6dd9608ce5f5bef29a9885a4.zip cpython-579db160b392404b6dd9608ce5f5bef29a9885a4.tar.gz cpython-579db160b392404b6dd9608ce5f5bef29a9885a4.tar.bz2 |
Closes #23247: Fix a crash in the StreamWriter.reset() of CJK codecs
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r-- | Modules/cjkcodecs/multibytecodec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 435529f..e0d9b67 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -1629,6 +1629,9 @@ mbstreamwriter_reset(MultibyteStreamWriterObject *self) { PyObject *pwrt; + if (!self->pending) + Py_RETURN_NONE; + pwrt = multibytecodec_encode(self->codec, &self->state, self->pending, NULL, self->errors, MBENC_FLUSH | MBENC_RESET); |