You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Fix a few cppcheck issues
Found the following: * Potential stack explosions with alloca() usage on potentially large strings * Memory leaks in WriteEngineServer * Stack usage out of scope in dataconvert * A typo in an 'if' statement in dataconvert
This commit is contained in:
@ -682,7 +682,7 @@ inline bool PrimitiveProcessor::isEscapedChar(char c)
|
||||
int PrimitiveProcessor::convertToRegexp(idb_regex_t* regex, const p_DataValue* str)
|
||||
{
|
||||
//In the worst case, every char is quadrupled, plus some leading/trailing cruft...
|
||||
char* cBuf = (char*)alloca(((4 * str->len) + 3) * sizeof(char));
|
||||
char* cBuf = new char[(4 * str->len) + 3];
|
||||
char c;
|
||||
int i, cBufIdx = 0;
|
||||
// translate to regexp symbols
|
||||
@ -763,6 +763,7 @@ int PrimitiveProcessor::convertToRegexp(idb_regex_t* regex, const p_DataValue* s
|
||||
regex->regex = cBuf;
|
||||
#endif
|
||||
regex->used = true;
|
||||
delete [] cBuf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user