(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestReadLatin1_OOM_Bug(t *testing.T) { |
| 94 | // We claim a massive size of 10,000 bytes, but provide an empty buffer. |
| 95 | buf := NewByteBuffer(nil) |
| 96 | |
| 97 | err := &Error{} |
| 98 | // readLatin1 doesn't read the length itself, it takes it as an argument |
| 99 | result := readLatin1(buf, 10000, err) |
| 100 | |
| 101 | require.True(t, err.HasError(), "Expected an error due to out of bounds buffer") |
| 102 | require.Equal(t, "", result, "Expected an empty string due to missing data") |
| 103 | } |
nothing calls this directly
no test coverage detected