prevent crash when packing too much

This commit is contained in:
David Rose 2005-03-09 19:55:33 +00:00
parent 4dd46f7ca1
commit 764d561740

View File

@ -705,6 +705,8 @@ pack_object(PyObject *object) {
bool is_instance = false;
const DCClass *dclass = NULL;
const DCPackerInterface *current_field = get_current_field();
if (current_field != (DCPackerInterface *)NULL) {
const DCClassParameter *class_param = get_current_field()->as_class_parameter();
if (class_param != (DCClassParameter *)NULL) {
dclass = class_param->get_class();
@ -715,6 +717,7 @@ pack_object(PyObject *object) {
Py_DECREF(class_def);
}
}
}
// If dclass is not NULL, the packer is expecting a class object.
// There are then two cases: (1) the user has supplied a matching