| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Fixes CVE-2026-56851Reference public issue (file public issue if none exists yet).
if nDst+need > len(dst) {This changes the function behavior when dst is too short: Previously, it would fill as much of dst as possible, while now it may fill only part of dst.
I don't know if this matters, but it's simple to avoid changing it so let's keep things as stable as possible: When assigning `dst[nDst] = ' '`, we can return an error if `nDst >= len(dst)`.
func TestTransform(t *testing.T) {There's a `TestTransformShortBuffers` in enforce_test.go. Looks like it currently only uses a profile that doesn't exercise the Nickname case. Can we make this run with various profiles (and possibly inputs) to exercise this fix?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Reference public issue (file public issue if none exists yet).
Done
This changes the function behavior when dst is too short: Previously, it would fill as much of dst as possible, while now it may fill only part of dst.
I don't know if this matters, but it's simple to avoid changing it so let's keep things as stable as possible: When assigning `dst[nDst] = ' '`, we can return an error if `nDst >= len(dst)`.
Done
There's a `TestTransformShortBuffers` in enforce_test.go. Looks like it currently only uses a profile that doesn't exercise the Nickname case. Can we make this run with various profiles (and possibly inputs) to exercise this fix?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Full disclosure: Gemini found all of this.
if size == 0 { // Incomplete UTF-8 encodingPreexisting problem: size is never 0, `DecodeRune` returns `(RuneError, 1)` when encountering a partial rune.
This results in, for example, `"a\xef\xb7"` (an input ending in an incomplete 3-byte rune) returning `"a\xef\xb7"` rather than `"a"` and ErrShortSrc.
return nDst, nSrc, transform.ErrShortDstThis leaves t.prevSpace set, but the space has already been appended to the destination.
For example, `"a b"` with a 2-byte destination produces `"a "`, and the next call produces `" b"` rather than `"b"`.
return nDst, nSrc, transform.ErrShortDstThis can write part of a multi-byte rune to the dst without advancing nSrc.
For example, `"\uFDFA"` (a 3-byte rune) with a 2-byte destination produces nSrc=0, nDst=2, and `"\xef\xb7"`. It should produce nSrc=0, nDst=0.
return nDst, nSrc, transform.ErrShortSrcMost transformers return a nil error when `nSrc == len(src) && !atEOF` (all source bytes consumed and written to dst, no dangling state).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Preexisting problem: size is never 0, `DecodeRune` returns `(RuneError, 1)` when encountering a partial rune.
This results in, for example, `"a\xef\xb7"` (an input ending in an incomplete 3-byte rune) returning `"a\xef\xb7"` rather than `"a"` and ErrShortSrc.
Done
This leaves t.prevSpace set, but the space has already been appended to the destination.
For example, `"a b"` with a 2-byte destination produces `"a "`, and the next call produces `" b"` rather than `"b"`.
Done
This can write part of a multi-byte rune to the dst without advancing nSrc.
For example, `"\uFDFA"` (a 3-byte rune) with a 2-byte destination produces nSrc=0, nDst=2, and `"\xef\xb7"`. It should produce nSrc=0, nDst=0.
Done
Most transformers return a nil error when `nSrc == len(src) && !atEOF` (all source bytes consumed and written to dst, no dangling state).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
return n, transform.ErrShortSrcI don't think this and the next three ErrShortSrc returns are correct. In this case, for example, we've detected a disallowed rune. Getting more data isn't going to change the rune into something allowed.
return n, transform.ErrShortSrcI think this ErrShortSrc return is correct, however, because the error here is for unterminated rules which might be terminated by following input.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |