Skip to content

Possible buffer overflow in TF1 / TString #8136

@hageboeck

Description

@hageboeck

Address sanitizer uncovered an unprotected memcpy happening here:

TString::TString(const char *cs, Ssiz_t n)
{
if (n < 0) {
Error("TString::TString", "Negative length!");
Zero();
return;
}
char *data = Init(n, n);
memcpy(data, cs, n);
}

Invoked from here:

if (TString(formula, 5) == "CONV(" && formula[strlen(formula) - 1] == ')') {

Note that it's always 5 characters being copied from the incoming string formula.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions