Skip to content

Conversation

@xchacha20-poly1305
Copy link
Contributor

  • If a field named _, CanSet() returns false.
  • Or (||) operation skips CanSet() check, causing panic.

@xchacha20-poly1305
Copy link
Contributor Author

Another bug:

Write incorrectly applies reflect.Indirect to the input rawData before passing it to the internal write function. This causes a panic when a nil pointer is passed because reflect.Indirect returns an invalid reflect.Value, and the subsequent error handling path attempts to call .String() on a nil type.

Furthermore, stripping the pointer type at the top level causes the encoder to bypass the pointer-handling logic that writes a presence marker (0 or 1). Because the Read function expects this marker to determine if it should allocate memory, the lack of this byte causes a protocol mismatch, leading to data corruption or decoding failures.

Trying to fix this may breaks the protocol behavior, so I will not create a pull request to fix it.

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.

1 participant