Commit 74a471c
authored
[DebugInfo] Add bounds check to source map VLQ decoder shift (#8331)
- `readBase64VLQ()` increments `shift` by 5 for each continuation digit
with no upper bound.
- After 7 continuation digits, `shift` reaches 35 and `digit << shift`
on a `uint32_t` is undefined behavior (shifting by >= type width).
- Added a bounds check after incrementing `shift`, throwing
`MapParseException` for malformed VLQ values with too many continuation
digits.1 parent b92b68d commit 74a471c
2 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
132 | 144 | | |
133 | 145 | | |
134 | 146 | | |
| |||
0 commit comments