Skip to content

Commit 1b08786

Browse files
Ev3ntbogdan.khavronin
authored andcommitted
Merge commit from fork
* vulnerability fix * stylistic changes that make code smoother * Revert "stylistic changes that make code smoother" This reverts commit bea0aa89e142ed41d596c4afee4b731141cbbc8a. * Revert "vulnerability fix" This reverts commit c1ea7b73aad36baf3489aa182a951a1a9e5fe716. * vulnerability fix --------- Co-authored-by: bogdan.khavronin <bogdan.khavronin@red-soft.ru>
1 parent 950292a commit 1b08786

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/remote/server/server.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ void loginSuccess(const string& login, const string& remId)
479479
remoteFailedLogins->loginSuccess(remId);
480480
}
481481

482+
static constexpr unsigned SEGMENT_DATA_SIZE = 254;
482483

483484
template <typename T>
484485
static void getMultiPartConnectParameter(T& putTo, Firebird::ClumpletReader& id, UCHAR param)
@@ -508,9 +509,10 @@ static void getMultiPartConnectParameter(T& putTo, Firebird::ClumpletReader& id,
508509
}
509510
checkBytes[offset] = 1;
510511

511-
offset *= 254;
512+
offset *= SEGMENT_DATA_SIZE;
512513
++specData;
513-
putTo.grow(offset + len);
514+
if (offset + len > putTo.getCount())
515+
putTo.grow(offset + len);
514516
memcpy(&putTo[offset], specData, len);
515517
}
516518
}

0 commit comments

Comments
 (0)