Commit 38d6eae
authored
fix: ubsan signed overflow violations (#347)
In these instances, the uint8_t inputs multiplied with the literal,
which is a signed long, will make a signed long. For certain
inputs, this will overflow, despite the return type being unsigned.
Fix by making it always unsigned in the first place.1 parent 99f3f4a commit 38d6eae
3 files changed
+24
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2632 | 2632 | | |
2633 | 2633 | | |
2634 | 2634 | | |
2635 | | - | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
2636 | 2638 | | |
2637 | 2639 | | |
2638 | 2640 | | |
| |||
2654 | 2656 | | |
2655 | 2657 | | |
2656 | 2658 | | |
2657 | | - | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
2658 | 2662 | | |
2659 | 2663 | | |
2660 | 2664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
276 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
| |||
599 | 603 | | |
600 | 604 | | |
601 | 605 | | |
602 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
603 | 609 | | |
604 | 610 | | |
605 | 611 | | |
| |||
647 | 653 | | |
648 | 654 | | |
649 | 655 | | |
650 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
651 | 659 | | |
652 | 660 | | |
653 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments