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

Add null terminator for char* based json string unescape, and precondition on input length #2303

Merged
merged 8 commits into from
Aug 10, 2022

Conversation

ahsonkhan
Copy link
Member

Fixes #2301

@ahsonkhan ahsonkhan added this to the [2022] August milestone Aug 8, 2022
@ahsonkhan ahsonkhan self-assigned this Aug 8, 2022
@ahsonkhan ahsonkhan marked this pull request as draft August 8, 2022 19:46
@ahsonkhan ahsonkhan marked this pull request as ready for review August 10, 2022 00:12
sdk/tests/core/test_az_json.c Show resolved Hide resolved
sdk/src/azure/core/az_json_token.c Show resolved Hide resolved
Copy link
Member

@antkmsft antkmsft left a comment

Choose a reason for hiding this comment

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

Will look good once covered by tests.
Functionality LGTM, I see no issues.

How does the code coverage look like? Strangely, I ger 404 when clicking on CI Details link.
(codecov still won't show us that we're not testing for null terminator)

sdk/tests/core/test_az_json.c Show resolved Hide resolved
@ahsonkhan ahsonkhan merged commit e88c6b0 into main Aug 10, 2022
@ahsonkhan ahsonkhan deleted the ahsonkhan-patch-1 branch August 10, 2022 01:59
danewalton added a commit to danewalton/azure-sdk-for-c that referenced this pull request Sep 15, 2022
…ition on input length (Azure#2303)

* Add null terminator for char* based json string unescape, and precondition on input length

* Add remark comment about precondition and null terimination

* Update doc comment typo

* Remove the test cases about insufficient space.

* Fix clang formatting.

* Add null terminator tests.

* Test that the null terminator is there at the end.

* Fix build errors.
danewalton added a commit to danewalton/azure-sdk-for-c that referenced this pull request Sep 15, 2022
…ition on input length (Azure#2303)

* Add null terminator for char* based json string unescape, and precondition on input length

* Add remark comment about precondition and null terimination

* Update doc comment typo

* Remove the test cases about insufficient space.

* Fix clang formatting.

* Add null terminator tests.

* Test that the null terminator is there at the end.

* Fix build errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add null terminator and precondition on input length for the json unescape method
3 participants