Skip to content

Commit 346eb69

Browse files
uzhastikvitstn
andauthored
Check GUC settings' length (#9083) (#11375)
Co-authored-by: Vitaly Stoyan <vvvv@ydb.tech>
1 parent 293e60f commit 346eb69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ydb/library/yql/parser/pg_wrapper/syscache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,10 @@ namespace NMiniKQL {
696696
void PgCreateSysCacheEntries(void* ctx) {
697697
auto main = (TMainContext*)ctx;
698698
if (main->GUCSettings) {
699-
if (main->GUCSettings->Get("ydb_database")) {
699+
if (main->GUCSettings->Get("ydb_database") && main->GUCSettings->Get("ydb_database")->size() < NAMEDATALEN) {
700700
main->CurrentDatabaseName = NYql::TSysCache::MakePgDatabaseHeapTuple(NYql::PG_CURRENT_DATABASE_ID, main->GUCSettings->Get("ydb_database")->c_str());
701701
}
702-
if (main->GUCSettings->Get("ydb_user")) {
702+
if (main->GUCSettings->Get("ydb_user") && main->GUCSettings->Get("ydb_user")->size() < NAMEDATALEN) {
703703
main->CurrentUserName = NYql::TSysCache::MakePgRolesHeapTuple(NYql::PG_CURRENT_USER_ID, main->GUCSettings->Get("ydb_user")->c_str());
704704
}
705705
}

0 commit comments

Comments
 (0)