Commit 7d1bd90
authored
Potential bug in TryWriteBytes (#2049)
InnerText has odd length (3 chars). Integer division means
InnerText.Length / 2 == 1, so a 1-byte buffer "matches" the truncated
size. The guard on line 142 uses && instead of ||, so it falls through
and the loop throws on the last Slice.1 parent d7aceaa commit 7d1bd90
2 files changed
Lines changed: 14 additions & 1 deletion
File tree
- src/DocumentFormat.OpenXml.Framework/SimpleTypes
- test/DocumentFormat.OpenXml.Tests/SimpleTypes
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| |||
0 commit comments