Skip to content

Conversation

@rmunn
Copy link
Collaborator

@rmunn rmunn commented Oct 17, 2024

I assumed that string.Substring(0, 100) was safe and that on a string of less than 100 characters it would just return the unmodified string. That would be the sensible thing to do — but the C# API loves to throw exceptions instead of doing the sensible thing. So we need to check the length ourselves before calling string.Substring.

@rmunn rmunn self-assigned this Oct 17, 2024
@rmunn rmunn requested a review from hahn-kev October 17, 2024 01:48
@github-actions
Copy link

Test Results

    2 files  ±0    21 suites  ±0   6m 2s ⏱️ -4s
316 tests ±0  294 ✔️ ±0  22 💤 ±0  0 ±0 
319 runs  ±0  297 ✔️ ±0  22 💤 ±0  0 ±0 

Results for commit 3602563. ± Comparison against base commit d41ad26.

@rmunn rmunn merged commit f4bdb42 into develop Oct 17, 2024
@rmunn rmunn deleted the bugfix/substring-too-long branch October 17, 2024 02:49
rmunn added a commit to sillsdev/web-languageforge that referenced this pull request Oct 18, 2024
This pulls in the bugfix for the CommentConversionError class from
sillsdev/LfMerge#350.
@rmunn rmunn linked an issue Nov 5, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix bug with too-long substrings

3 participants