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.
This commit is contained in:
Xiang Zhang 2018-10-31 19:49:16 +08:00 committed by GitHub
parent 511747bec3
commit b08746bfdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View file

@ -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;