diff options
Diffstat (limited to 'Modules/cPickle.c')
-rw-r--r-- | Modules/cPickle.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 17ccb45..31a59f2 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -2217,7 +2217,8 @@ dump(Picklerobject *self, PyObject *args) char bytes[2]; bytes[0] = PROTO; - bytes[1] = self->proto; + assert(self->proto >= 0 && self->proto < 256); + bytes[1] = (char)self->proto; if (self->write_func(self, bytes, 2) < 0) return -1; } |