Skip to content

overlapping-encode-buffers

Detect overlapping source and destination encoding buffers.

Updated View as Markdown

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.

Bad

hex.Encode(buffer, buffer)

Good

hex.Encode(destination, source)
Navigation

Type to search…

↑↓ navigate↵ selectEsc close