Skip to content

Commit 5a49f64

Browse files
authored
Check GUC settings' length (#9083)
1 parent f7f9aba commit 5a49f64

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
@@ -756,10 +756,10 @@ namespace NMiniKQL {
756756
void PgCreateSysCacheEntries(void* ctx) {
757757
auto main = (TMainContext*)ctx;
758758
if (main->GUCSettings) {
759-
if (main->GUCSettings->Get("ydb_database")) {
759+
if (main->GUCSettings->Get("ydb_database") && main->GUCSettings->Get("ydb_database")->size() < NAMEDATALEN) {
760760
main->CurrentDatabaseName = NYql::TSysCache::MakePgDatabaseHeapTuple(NYql::PG_CURRENT_DATABASE_ID, main->GUCSettings->Get("ydb_database")->c_str());
761761
}
762-
if (main->GUCSettings->Get("ydb_user")) {
762+
if (main->GUCSettings->Get("ydb_user") && main->GUCSettings->Get("ydb_user")->size() < NAMEDATALEN) {
763763
main->CurrentUserName = NYql::TSysCache::MakePgRolesHeapTuple(NYql::PG_CURRENT_USER_ID, main->GUCSettings->Get("ydb_user")->c_str());
764764
}
765765
}

0 commit comments

Comments
 (0)