diff options
author | Xiang Zhang <angwerzx@126.com> | 2018-10-31 19:49:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-31 19:49:16 +0800 |
commit | b08746bfdf64e55ce33516f2065fa2aa4f51be95 (patch) | |
tree | 2db76a41e51aea8b2af9f3ee05b0a94cf16e046d /Modules/_io/textio.c | |
parent | 511747bec3aca4ad7930005e3adece9196c1cd39 (diff) | |
download | cpython-git-b08746bfdf64e55ce33516f2065fa2aa4f51be95.tar.gz |
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r-- | Modules/_io/textio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 3a3667b39d..be42777281 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -261,7 +261,7 @@ _io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self, } Py_INCREF(self->errors); - self->translate = translate; + self->translate = translate ? 1 : 0; self->seennl = 0; self->pendingcr = 0; |