Repository navigation
correct indexOf bounds check for charset parsing [Fix] - #2101
abhaygoudannavar wants to merge 1 commit into
Conversation
|
The |
Signed-off-by: abhaygoudannavar <[email protected]>
|
@Vaishnav88sk I hadn't considered the edge case of a malformed Content-Type starting with a semicolon resulting in an empty string. I've pushed an updated commit that extracts the index, ensures it is != -1 (to satisfy Sonar S2692), and safely checks > 0 before extracting the substring to prevent any empty strings. Thanks for pointing that out |
Summary
Correct
indexOfbounds check from> 0to>= 0during charset parsing, addressing 2 of the critical bug findings raised by SonarCloud and aggregated under #2058.Sites changed
OpenAPISchemaValidator#getMessageContentNodeGraphQLTestRunner#buildTestReturnNotes
This rule (
java:S2692- indexOf checks should not ignore index 0) flagged logic where splitting the string via.indexOf(";")was erroneously ignoring the 0th index due to a strict> 0check.