dump(): Added asserts that self->proto is sane.

This commit is contained in:
Tim Peters 2003-02-02 16:16:30 +00:00
parent 9b1e03ff4b
commit 87482ea055
1 changed files with 2 additions and 1 deletions

View File

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