Commit d246b36
#1176 Fix memory out of bounds memory write when bulk overriding components
without this fix, the newly introduced test case would segfault. This bug happens due to the fact that in C you loop count times, but also offset the dest_ptr, and then within the copy impl of C++, it loops count again, this means you would go count-1 * size_obj out of memory bounds for src as well as dest ptr.
This fix is the correct fix as it limits src ptr to just 1, while the dest ptr still gets offset each iteration.
(this was previously discussed with sanders, the information above is just for tracking why & what)1 parent 87f9ae6 commit d246b36
File tree
5 files changed
+99
-44
lines changed- src
- test/api
- src
5 files changed
+99
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15148 | 15148 | | |
15149 | 15149 | | |
15150 | 15150 | | |
15151 | | - | |
| 15151 | + | |
15152 | 15152 | | |
15153 | 15153 | | |
15154 | 15154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
| 503 | + | |
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
| 1071 | + | |
| 1072 | + | |
1072 | 1073 | | |
1073 | 1074 | | |
1074 | 1075 | | |
| |||
0 commit comments