Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Config File Parsing Logic to Parse Services Section #51

Merged
merged 13 commits into from
Jan 8, 2025

Conversation

waahm7
Copy link
Contributor

@waahm7 waahm7 commented Jan 6, 2025

Issue #, if available:
awslabs/aws-crt-swift#308

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@waahm7 waahm7 changed the title Config service section Update Config File Parsing Logic to Parse Services Section Jan 6, 2025
Comment on lines 870 to 871
if (s_parse_by_token(profile_cursor, s_profile_token, NULL) &&
s_parse_by_character_predicate(profile_cursor, s_is_whitespace, NULL, 1)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug in theory: if s_parse_by_token() returns true but s_parse_by_character_predicate() returns false, then profile_cursor is unexpectedly advanced, and the next if (s_parse_by_token(.... block will do unexpected things.

So like it starts with invalid nonsense like "profilesso-session", then the first if-block in this function will advance the cursor to be "sso-session" and then the second if-block would pass, but like ... neither should pass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's a great catch. I have fixed it and added a test.

source/aws_profile.c Outdated Show resolved Hide resolved
@waahm7 waahm7 merged commit 1ae8664 into main Jan 8, 2025
36 checks passed
@waahm7 waahm7 deleted the config-service-section branch January 8, 2025 19:36
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.

2 participants