aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2023-10-31 07:38:00 +0300
committeraneporada <aneporada@ydb.tech>2023-10-31 07:58:25 +0300
commitf17b3be239426a47af2ecc5e1122dde81ba15db8 (patch)
tree4afb6e55a354226b4962f6b0f9da31ac71c5c6e0
parent57e26ef4bdbb70dc1d29ce3980a7c55545325246 (diff)
downloadydb-f17b3be239426a47af2ecc5e1122dde81ba15db8.tar.gz
Fix heap buffer overflow
-rw-r--r--ydb/library/yql/parser/pg_wrapper/comp_factory.cpp2
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());
}