Prevent out-of-bounds writes in GetTempate
codexReview effort 1/5aardvark
### Motivation
`GetTempate` in `addtorrent.pas` parses space-separated template entries into a fixed-size destination array without checking its bounds. Supplying more entries than the array can hold may cause an out-of-bounds write or a range-check exception.
### Description
- Check `High(e)` before writing to `e[n]`.
- Stop parsing when the destination array is full.
- Preserve the existing behavior for entries that fit within the array.
### Testing
- Verified that the bounds check occurs before the array write.
- Confirmed that oversized input stops parsing once the destination array is full.
合并状态:未合并 6 条评论