Skip to content

Commit 7fccd73

Browse files
committed
Update security.md
1 parent 0e5f7e3 commit 7fccd73

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Binary formats like BEVE encode length headers that indicate how many elements o
1414

1515
#### How Glaze Protects Against This
1616

17-
Glaze validates length headers against the remaining buffer size **before** any memory allocation. If a length header claims more data than exists in the buffer, parsing fails immediately with `error_code::unexpected_end`.
17+
Glaze validates length headers against the remaining buffer size **before** any memory allocation. If a length header claims more data than exists in the buffer, parsing fails immediately with `error_code::invalid_length`.
1818

1919
```cpp
2020
// Example: Malicious buffer claiming 1 billion strings
2121
std::vector<std::string> result;
2222
auto ec = glz::read_beve(result, malicious_buffer);
23-
// ec.ec == glz::error_code::unexpected_end
23+
// ec.ec == glz::error_code::invalid_length
2424
// No memory was allocated for the claimed 1 billion strings
2525
```
2626

0 commit comments

Comments
 (0)