mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare] Symbol: fix uninitialized read (valgrind)
This commit is contained in:
@@ -161,9 +161,10 @@ bool SymbolNode::isUnknown(CodePoint unknownSymbol) const {
|
||||
Symbol Symbol::Builder(CodePoint name) {
|
||||
constexpr int bufferSize = CodePoint::MaxCodePointCharLength + 1;
|
||||
char buffer[bufferSize];
|
||||
int codePointSize = UTF8Decoder::CodePointToChars(name, buffer, bufferSize);
|
||||
assert(codePointSize <= bufferSize);
|
||||
return Symbol::Builder(buffer, codePointSize);
|
||||
int codePointLength = UTF8Decoder::CodePointToChars(name, buffer, bufferSize);
|
||||
assert(codePointLength < bufferSize);
|
||||
buffer[codePointLength] = 0;
|
||||
return Symbol::Builder(buffer, codePointLength);
|
||||
}
|
||||
|
||||
bool Symbol::isSeriesSymbol(const char * c) {
|
||||
|
||||
Reference in New Issue
Block a user