Commit 3f4f55d
committed
[ml] Fix out-of-bounds read in filtered cluster split
In RClusterLoader::LoadTrainingClusterInto the boundary entry was read
from rdfEntries unconditionally before checking valCount, so when one
side of the split is empty the access was past end-of-vector. This was
silent in non-hardened builds but trips libstdc++ assertions (e.g. with
libcxxhardeningfast), aborting test09_filtered_last_chunk.
Compute the boundary only when the corresponding rdfEntries index is
in-bounds, falling back to the cluster endpoint otherwise.
(cherry picked from commit 6183bad)1 parent 428633d commit 3f4f55d
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
417 | 427 | | |
418 | 428 | | |
419 | 429 | | |
| |||
0 commit comments