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

[CRE-42] Fix partial or truncated writes #989

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

agparadiso
Copy link
Contributor

@agparadiso agparadiso commented Jan 9, 2025

Description

This fix validates that the size specified matches the actual length of the data being written in order to avoid partial/truncated writes or unwanted data if the size is bigger than the actual data written. More info on the ticket
CRE-42

Requires

Supports

krehermann
krehermann previously approved these changes Jan 9, 2025
@@ -553,29 +553,43 @@ func Test_read(t *testing.T) {
}

func Test_write(t *testing.T) {
t.Run("successfully write to slice", func(t *testing.T) {
t.Run("OK-successfully_write_to_slice", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

these OK/NOK are out of character with the rest of the code base; recommend removing them

and, there is no need to explicitly underscore the names; the go tooling does it under the hood

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed 👍🏼

@cedric-cordenier cedric-cordenier merged commit 7dbb1b0 into main Jan 10, 2025
11 checks passed
@cedric-cordenier cedric-cordenier deleted the fix/CRE-42_partial_or_truncated_writes branch January 10, 2025 10:10
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.

3 participants