mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix: buffer overrun when passing long command name from lua (#2008)
Also, few additional changes that do not affect functionality. 1. make sure passed arguments to DispatchCommand are `\0` delimited during pipelining. 2. extend lua malloc hook to call precise functions - to help with cpu profiling. 3. reuse arguments buffer (save allocations) when calling Dragonfly command from lua scripts. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
c6f8f3882a
commit
ec87114f66
7 changed files with 56 additions and 36 deletions
|
@ -371,6 +371,7 @@ void InterpreterReplier::PostItem() {
|
|||
|
||||
void InterpreterReplier::SendError(string_view str, std::string_view type) {
|
||||
DCHECK(array_len_.empty());
|
||||
DVLOG(1) << "Lua/df_call error " << str;
|
||||
explr_->OnError(str);
|
||||
}
|
||||
|
||||
|
@ -1377,7 +1378,7 @@ optional<CapturingReplyBuilder::Payload> Service::FlushEvalAsyncCmds(ConnectionC
|
|||
|
||||
void Service::CallFromScript(ConnectionContext* cntx, Interpreter::CallArgs& ca) {
|
||||
DCHECK(cntx->transaction);
|
||||
DVLOG(1) << "CallFromScript " << cntx->transaction->DebugId() << " " << ArgS(ca.args, 0);
|
||||
DVLOG(1) << "CallFromScript " << ArgS(ca.args, 0);
|
||||
|
||||
InterpreterReplier replier(ca.translator);
|
||||
facade::SinkReplyBuilder* orig = cntx->Inject(&replier);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue