8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 08:03:04 +01:00

Backported fix for #7545: Server crash on some LockMemSize values

This commit is contained in:
AlexPeshkoff 2023-04-14 13:24:04 +03:00
parent d53aa4985b
commit ad00203c1e
3 changed files with 7 additions and 5 deletions

View File

@ -286,7 +286,7 @@ void Config::loadValues(const ConfigFile& file)
const ConfigEntry& entry = entries[i];
const ConfigFile::Parameter* par = file.findParameter(entry.key);
if (par)
if (par && (par->hasValue || par->sub))
{
// Assign the actual value
@ -505,8 +505,8 @@ int Config::getDummyPacketInterval() const
int Config::getLockMemSize() const
{
int size = get<int>(KEY_LOCK_MEM_SIZE);
if (size < 64 * 1024)
size = 64 * 1024;
if (size < 256 * 1024)
size = 256 * 1024;
return size;
}

View File

@ -305,6 +305,7 @@ ConfigFile::LineType ConfigFile::parseLine(const char* fileName, const String& i
if (par.name.isEmpty()) // not good - no key
return LINE_BAD;
valStart = n + 1;
par.hasValue = true;
}
else if (inString >= 2) // Something after the end of line
return LINE_BAD;

View File

@ -77,10 +77,10 @@ public:
{
Parameter(MemoryPool& p, const Parameter& par)
: AutoStorage(p), name(getPool(), par.name), value(getPool(), par.value),
sub(par.sub), line(par.line)
sub(par.sub), line(par.line), hasValue(par.hasValue)
{ }
Parameter()
: AutoStorage(), name(getPool()), value(getPool()), sub(0), line(0)
: AutoStorage(), name(getPool()), value(getPool()), sub(0), line(0), hasValue(false)
{ }
SINT64 asInteger() const;
@ -90,6 +90,7 @@ public:
String value;
Firebird::RefPtr<ConfigFile> sub;
unsigned int line;
bool hasValue;
static const KeyType* generate(const Parameter* item)
{