diff options
author | aneporada <aneporada@ydb.tech> | 2023-10-31 07:38:00 +0300 |
---|---|---|
committer | aneporada <aneporada@ydb.tech> | 2023-10-31 07:58:25 +0300 |
commit | f17b3be239426a47af2ecc5e1122dde81ba15db8 (patch) | |
tree | 4afb6e55a354226b4962f6b0f9da31ac71c5c6e0 | |
parent | 57e26ef4bdbb70dc1d29ce3980a7c55545325246 (diff) | |
download | ydb-f17b3be239426a47af2ecc5e1122dde81ba15db8.tar.gz |
Fix heap buffer overflow
-rw-r--r-- | ydb/library/yql/parser/pg_wrapper/comp_factory.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp b/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp index c8dbff384c..fae36570fc 100644 --- a/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp +++ b/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp @@ -1792,7 +1792,7 @@ struct TToPgExec { tmp.resize(len); NUdf::ZeroMemoryContext(tmp.data() + sizeof(void*)); - memcpy(tmp.data() + sizeof(void*) + VARHDRSZ, item.AsStringRef().Data(), len - VARHDRSZ); + memcpy(tmp.data() + sizeof(void*) + VARHDRSZ, item.AsStringRef().Data(), len - VARHDRSZ - sizeof(void*)); UpdateCleanVarSize((text*)(tmp.data() + sizeof(void*)), item.AsStringRef().Size()); } |