aboutsummaryrefslogtreecommitdiffstats
path: root/yt
diff options
context:
space:
mode:
authorkvk1920 <kvk1920@yandex-team.com>2024-09-06 21:39:24 +0300
committerkvk1920 <kvk1920@yandex-team.com>2024-09-06 21:54:23 +0300
commit1db34968b62efd36baf1e286042c6c797e33e985 (patch)
treeba66176040b915780922d45349bb09700eb45e72 /yt
parent7ce23f89bc06d15aac55a0ee6b00ebda7fcf235c (diff)
downloadydb-1db34968b62efd36baf1e286042c6c797e33e985.tar.gz
Fix use-after-free
Use-after-free bug was introduced in commit with native transaction externalization: ExecuteVerb() didn't expect request header to change during resolve. 2bda20c9c3e2d5d362dd02b53019bda81db99be5
Diffstat (limited to 'yt')
-rw-r--r--yt/yt/core/ytree/ypath_client.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/yt/yt/core/ytree/ypath_client.cpp b/yt/yt/core/ytree/ypath_client.cpp
index 7a4cd258bd..a07176978b 100644
--- a/yt/yt/core/ytree/ypath_client.cpp
+++ b/yt/yt/core/ytree/ypath_client.cpp
@@ -285,7 +285,10 @@ void ResolveYPath(
auto currentService = rootService;
- const auto& originalPath = GetOriginalRequestTargetYPath(context->RequestHeader());
+ // NB: of course, we could use reference here. But Resolve() can change
+ // request header due to master compat.
+ // COMPAT(kvk1920): use const reference.
+ auto originalPath = GetOriginalRequestTargetYPath(context->RequestHeader());
auto currentPath = GetRequestTargetYPath(context->RequestHeader());
int iteration = 0;