secondlife / secondlife/viewer
[Potential bug?] LLBase64::decodeAsString truncates at null byte
Open
bug
- Dominant language
- C++
- Stars
- 299
- Forks
- 146
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 88
Description
Environment
26.3.0.31203661088
Description
LLBase64::decodeAsString uses res.assign(b64_buffer);, which copies a string up until \0. I'm unsure if this is intentional or not, given that base64 is typically used to convey byte data rather than string data.
Either way, this came up when debugging. I can write around it if this is intentional, but figured I'd bring it up just in case it isn't.
Easy fix is to just do res.assign(b64_buffer, b64_buffer_length); instead. I can submit a PR if this is deemed a bug.
Reproduction steps
- Attempt to decode bytes containing a
\0usingLLBase64::decodeAsString - Observe that the output is truncated
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.