MCPcopy Create free account
hub / github.com/ElementsProject/elements / LegacyParsePrechecks

Function LegacyParsePrechecks

src/test/fuzz/string.cpp:39–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38namespace {
39bool LegacyParsePrechecks(const std::string& str)
40{
41 if (str.empty()) // No empty string allowed
42 return false;
43 if (str.size() >= 1 && (IsSpace(str[0]) || IsSpace(str[str.size() - 1]))) // No padding allowed
44 return false;
45 if (!ValidAsCString(str)) // No embedded NUL characters allowed
46 return false;
47 return true;
48}
49
50bool LegacyParseInt32(const std::string& str, int32_t* out)
51{

Callers 4

LegacyParseInt32Function · 0.85
LegacyParseInt64Function · 0.85
LegacyParseUInt32Function · 0.85
LegacyParseUInt64Function · 0.85

Calls 4

IsSpaceFunction · 0.85
ValidAsCStringFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected