Skip to content

overlapping-encode-buffers

Default severity: warning

Byte encoders that expand their input can overwrite source bytes before reading them when destination and source begin at the same memory. Use separate storage or a destination region proven not to overlap.

The check covers the standard ASCII85, base32, base64, and hexadecimal encoders.

hex.Encode(buffer, buffer)
hex.Encode(destination, source)