Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add guard when converting from i64 to usize
In some cases, when bad data is passed in as a set of change to parinfer-rust it can cause parinfer-rust to crash. This crash is caused by trying to add indents to a line. When the delta calculated turns out to be negative and when that is added to orig_indent that can cause issues when type casting to usize (Column). This is because the combination of these two variables can be negative and when type cast to a usize it causes the number to be very large, in my case something like 1.8 trillion. So when this number is then used to determine how many times to repeat a string, it causes the library to run out of memory and crash.
- Loading branch information