diff options
author | ilnurkh <ilnurkh@yandex-team.com> | 2023-01-23 09:51:46 +0300 |
---|---|---|
committer | ilnurkh <ilnurkh@yandex-team.com> | 2023-01-23 09:51:46 +0300 |
commit | 6b86da079d2677e428c32d096a69a18b82ff129b (patch) | |
tree | 1bd898e8eea310e973fbb115179c244805158345 | |
parent | 23f7183c1ab21f4771d41e3bdc8ce88436a516a9 (diff) | |
download | ydb-6b86da079d2677e428c32d096a69a18b82ff129b.tar.gz |
TMemoryInput Try to prohibit use-after-free and require explicit cast to TStringBuf (with &&)
-rw-r--r-- | util/stream/mem.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/stream/mem.h b/util/stream/mem.h index 18a5d46772..cad6dfb975 100644 --- a/util/stream/mem.h +++ b/util/stream/mem.h @@ -26,7 +26,13 @@ public: * @param len Size of the memory block. */ TMemoryInput(const void* buf, size_t len) noexcept; + TMemoryInput(TString&&) = delete; explicit TMemoryInput(const TStringBuf buf) noexcept; + explicit TMemoryInput(const char* zstr) + : TMemoryInput(TStringBuf(zstr)) + { + } + ~TMemoryInput() override; TMemoryInput(const TMemoryInput& other) noexcept |