Commit 42c4d6a
committed
fix buffer overflow
- pcu/pcu_coll.c (pcu_merge_gather): fix buffer overflow on the local
array when number of peers is odd. I was assuming that with power of 2
peers the local array always has an even size. Now, memcpy will never
write past local + size.
- added comment explaining it.
Signed-off-by: Aiden Woodruff <[email protected]>1 parent 75fe494 commit 42c4d6a
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | 420 | | |
423 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
424 | 426 | | |
425 | 427 | | |
426 | 428 | | |
| |||
0 commit comments