Skip to content

Commit d71477f

Browse files
authored
Fix KSChan point-process OOB write of dparam[2] (#3843) (#3844)
KSChan::alloc always nulled prop->dparam[2] for point processes, but that slot exists only when single-channel mode (or later fields) makes ppsize > 2. Plain point KSChan instances allocate only area and pnt, so the write was past the allocated Datum vector. The default ArrayPool freelist order hid the overflow inside the next free slab row; a reversed freelist exposes it under ASAN. nrn_prop_datum_alloc already default-constructs every Datum to null, and dparam[0]/[1] are filled by point.cpp after nrn_alloc. The redundant nulling is removed; single_->alloc still runs when single_ is set and the singleptr slot is null.
1 parent 1739c01 commit d71477f

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

src/nrniv/kschan.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,9 +2328,6 @@ void KSChan::alloc(Prop* prop) {
23282328
if (!is_point() || nrn_point_prop_ == 0) {
23292329
if (ppsize > 0) {
23302330
prop->dparam = nrn_prop_datum_alloc(prop->_type, ppsize, prop);
2331-
if (is_point()) {
2332-
prop->dparam[2] = nullptr;
2333-
}
23342331
} else {
23352332
prop->dparam = 0;
23362333
}

0 commit comments

Comments
 (0)