Skip to content

Fix allownil propagated to byte slices as slice elements#374

Merged
klauspost merged 1 commit intotinylib:masterfrom
klauspost:fix-allownil-on-elements
Oct 22, 2024
Merged

Fix allownil propagated to byte slices as slice elements#374
klauspost merged 1 commit intotinylib:masterfrom
klauspost:fix-allownil-on-elements

Conversation

@klauspost
Copy link
Collaborator

[][]byte would assume that the byte slices had allownil set. This would cause an extra if x == nil {x = make([]byte,0)} to be inserted on elements.

Regression from #363

`[][]byte` would assume that the byte slices had allownil set. This would cause an extra `if x == nil {x = make([]byte,0)}` to be inserted on elements.

Regression from tinylib#363
@klauspost klauspost merged commit 65798b6 into tinylib:master Oct 22, 2024
@klauspost klauspost deleted the fix-allownil-on-elements branch October 22, 2024 11:19
klauspost added a commit to klauspost/msgp that referenced this pull request Oct 22, 2024
Similar to tinylib#374 map `[]byte` elements would also inherit allownil unintentionally.
klauspost added a commit that referenced this pull request Oct 22, 2024
* Fix allownil on maps elements
* Also set for primitives.

Similar to #374 map `[]byte` elements would also inherit allownil unintentionally.
@craig65535
Copy link

@klauspost Could a new release be made with this fix?

@klauspost
Copy link
Collaborator Author

@craig65535
Copy link

@klauspost Thank you!

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