aboutsummaryrefslogtreecommitdiff
path: root/tests/fuzz/levin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fuzz/levin.cpp')
-rw-r--r--tests/fuzz/levin.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/fuzz/levin.cpp b/tests/fuzz/levin.cpp
index 012d05f36..b090c350b 100644
--- a/tests/fuzz/levin.cpp
+++ b/tests/fuzz/levin.cpp
@@ -65,13 +65,13 @@ namespace
{
}
- virtual int invoke(int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, test_levin_connection_context& context)
+ virtual int invoke(int command, const epee::span<const uint8_t> in_buff, epee::byte_slice& buff_out, test_levin_connection_context& context)
{
m_invoke_counter.inc();
boost::unique_lock<boost::mutex> lock(m_mutex);
m_last_command = command;
m_last_in_buf = std::string((const char*)in_buff.data(), in_buff.size());
- buff_out = m_invoke_out_buf;
+ buff_out = m_invoke_out_buf.clone();
return m_return_code;
}
@@ -111,8 +111,7 @@ namespace
int return_code() const { return m_return_code; }
void return_code(int v) { m_return_code = v; }
- const std::string& invoke_out_buf() const { return m_invoke_out_buf; }
- void invoke_out_buf(const std::string& v) { m_invoke_out_buf = v; }
+ void invoke_out_buf(std::string v) { m_invoke_out_buf = epee::byte_slice{std::move(v)}; }
int last_command() const { return m_last_command; }
const std::string& last_in_buf() const { return m_last_in_buf; }
@@ -127,7 +126,7 @@ namespace
boost::mutex m_mutex;
int m_return_code;
- std::string m_invoke_out_buf;
+ epee::byte_slice m_invoke_out_buf;
int m_last_command;
std::string m_last_in_buf;