Ticket #495: crash_precond.diff
File crash_precond.diff, 2.7 KB (added by greg, at 2008-07-25T16:32:18Z) |
---|
-
zfec\_fecmodule.c
old new 62 62 return -1; 63 63 64 64 if (ink < 1) { 65 PyErr_Format(py_fec_error, "Precondition violation: first argument is required to be greater than or equal to 1, but it was %d", self->kk);65 PyErr_Format(py_fec_error, "Precondition violation: first argument is required to be greater than or equal to 1, but it was %d", ink); 66 66 return -1; 67 67 } 68 68 if (inm < 1) { 69 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be greater than or equal to 1, but it was %d", self->mm);69 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be greater than or equal to 1, but it was %d", inm); 70 70 return -1; 71 71 } 72 72 if (inm > 256) { 73 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be less than or equal to 256, but it was %d", self->mm);73 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be less than or equal to 256, but it was %d", inm); 74 74 return -1; 75 75 } 76 76 if (ink > inm) { … … 220 220 221 221 static void 222 222 Encoder_dealloc(Encoder * self) { 223 fec_free(self->fec_matrix); 223 if (self->fec_matrix) 224 fec_free(self->fec_matrix); 224 225 self->ob_type->tp_free((PyObject*)self); 225 226 } 226 227 … … 321 322 return -1; 322 323 323 324 if (ink < 1) { 324 PyErr_Format(py_fec_error, "Precondition violation: first argument is required to be greater than or equal to 1, but it was %d", self->kk);325 PyErr_Format(py_fec_error, "Precondition violation: first argument is required to be greater than or equal to 1, but it was %d", ink); 325 326 return -1; 326 327 } 327 328 if (inm < 1) { 328 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be greater than or equal to 1, but it was %d", self->mm);329 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be greater than or equal to 1, but it was %d", inm); 329 330 return -1; 330 331 } 331 332 if (inm > 256) { 332 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be less than or equal to 256, but it was %d", self->mm);333 PyErr_Format(py_fec_error, "Precondition violation: second argument is required to be less than or equal to 256, but it was %d", inm); 333 334 return -1; 334 335 } 335 336 if (ink > inm) { … … 492 493 493 494 static void 494 495 Decoder_dealloc(Decoder * self) { 495 fec_free(self->fec_matrix); 496 if (self->fec_matrix) 497 fec_free(self->fec_matrix); 496 498 self->ob_type->tp_free((PyObject*)self); 497 499 } 498 500