Skip to content

concore.hpp initval() segfaults on empty input #427

@avinxshKD

Description

@avinxshKD

initval() does simtime = val[0] right after parsing without checking if val is empty. Pass it "[]" or garbage string and it's instant UB/segfault.

vector<double> val = parser(f);
simtime = val[0];          // boom
val.erase(val.begin());    // double boom

read_FM and read_SM in the same file already do if(inval.empty()) return inval; so someone knew about this. initval just got skipped.

concoredocker.hpp handles it fine (if (!val.empty())). Python side too. Only concore.hpp is broken.

not hard to fix, just add the empty check before accessing [0]. but its a crash in core library code so kinda important

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions