aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnurkh <ilnurkh@yandex-team.com>2023-01-23 09:51:46 +0300
committerilnurkh <ilnurkh@yandex-team.com>2023-01-23 09:51:46 +0300
commit6b86da079d2677e428c32d096a69a18b82ff129b (patch)
tree1bd898e8eea310e973fbb115179c244805158345
parent23f7183c1ab21f4771d41e3bdc8ce88436a516a9 (diff)
downloadydb-6b86da079d2677e428c32d096a69a18b82ff129b.tar.gz
TMemoryInput Try to prohibit use-after-free and require explicit cast to TStringBuf (with &&)
-rw-r--r--util/stream/mem.h6
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