Update sbieiniserver.cpp

This commit is contained in:
DavidXanatos 2023-04-20 21:53:45 +02:00
parent bfffaf96a0
commit ac4d33e2c1
1 changed files with 3 additions and 1 deletions

View File

@ -1174,8 +1174,10 @@ ULONG SbieIniServer::AddSetting(MSG_HEADER* msg, bool insert)
{
if (_wcsicmp(I->Name.c_str(), req->setting) == 0) {
// !insert -> append -> find last entry
if(!insert || pos == pSection->Entries.end())
if (!insert || pos == pSection->Entries.end()) {
pos = I;
if (!insert) pos++;
}
if (_wcsicmp(I->Value.c_str(), req->value) == 0) {
// this value is already present, so let's abort right here
return STATUS_SUCCESS;