Commit c69a781
authored
Prevent undefined behavior with
Fixes an issue where `--cpp-lines` could attempt to index an empty
string with `-1`.
In some cases, `cp` could be `""` and `strlen(cp)` would be 0. This
means we would attempt to index the array with a negative value
(undefined behavior!)
[Reviewed by @arifthpe]--cpp-lines (#29041)1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 230 | + | |
| 231 | + | |
235 | 232 | | |
236 | 233 | | |
237 | 234 | | |
| |||
0 commit comments