Commit b124d50
authored
## Description
Update guard logic to permit writing 0 length buffers. This can happen in certain globalized scenarios (ex. `¿` with Portugese) where the first char needs to be encoded.
Patch #31299 for 5.0 by cherry-picking the #32277 squash commit.
## Customer Impact
Writing 0-length char buffers leads to an ArgumentOutOfRangeException. This may occur in a globalization context with certain chars such as `¿`.
#31299 (comment)
Also impacts Orchard: #31299 (comment)
## Regression?
- [ ] Yes
- [x] No
[If yes, specify the version the behavior has regressed from]
## Risk
- [ ] High
- [ ] Medium
- [x] Low
Low risk as we've just updated the logic slightly to permit 0 length buffers.
## Verification
- [x] Manual (required)
- [x] Automated
## Packaging changes reviewed?
- [ ] Yes
- [ ] No
- [x] N/A
Addresses #31299
1 parent e6998cb commit b124d50
File tree
2 files changed
+25
-4
lines changed- src/Mvc/Mvc.ViewFeatures
- src/Buffers
- test/Buffers
2 files changed
+25
-4
lines changedLines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
| |||
326 | 331 | | |
327 | 332 | | |
328 | 333 | | |
329 | | - | |
| 334 | + | |
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
127 | 143 | | |
128 | 144 | | |
129 | 145 | | |
| |||
170 | 186 | | |
171 | 187 | | |
172 | 188 | | |
173 | | - | |
| 189 | + | |
0 commit comments