TAChart: some additional range checks for TFitSeries
Original Reporter info from Mantis: Marcin Wiazowski
-
Reporter name:
Original Reporter info from Mantis: Marcin Wiazowski
- Reporter name:
Description:
When experimenting with TFitSeries, I quickly faced some random memory corruptions. Then I realized, that I unintentionally overwritten some memory by using out-of-range calls to TFitSeries.SetFitBasisFunc().
As can be seen, calls to TFitSeries.Param[] property are properly validated for out-of-range indices, but some other public methods are not validated.
So I'm attaching a patch that adds some validation to public methods. It also changes one Exception to EChartError, which seems to be more consistent with rest of the code.
Note: I used ClassName in error messages; it could be even better to use a function like "SourceClassString", that is in tasources.pas (BTW, maybe renaming it to something like "NameOrClassString" would be good).
Mantis conversion info:
- Mantis ID: 35175
- Build: 60555
- Version: 2.1 (SVN)
- Fixed in revision: 60561 (#11d96908)
- Target version: 2.2