---
title: "overlapping-encode-buffers"
description: "Detect overlapping source and destination encoding buffers."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

## Bad

```go
hex.Encode(buffer, buffer)
```

## Good

```go
hex.Encode(destination, source)
```

Source: https://strider.gempir.com/analyzers/overlapping-encode-buffers/index.mdx
