1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-17 16:53:13 +00:00

Fixed bug with ScriptContainer JSON dispatcher, that caused the child to crash

This commit is contained in:
Bryan Roe
2022-07-12 18:35:49 -07:00
parent f4880573f3
commit 4e8aa9e782

View File

@@ -3806,9 +3806,9 @@ duk_ret_t ILibDuktape_ScriptContainer_SendToSlave(duk_context *ctx)
char *payload = duk_push_fixed_buffer(ctx, jsonlen + 5); char *payload = duk_push_fixed_buffer(ctx, jsonlen + 5);
len = sprintf_s(payload + 4, jsonlen + 1, "%s", json); len = sprintf_s(payload + 4, jsonlen + 1, "%s", json);
((int*)json)[0] = len + 4; ((int*)payload)[0] = len + 4;
ILibProcessPipe_Process_WriteStdIn(master->child, json, len + 4, ILibTransport_MemoryOwnership_USER); ILibProcessPipe_Process_WriteStdIn(master->child, payload, len + 4, ILibTransport_MemoryOwnership_USER);
} }
else if(master->PeerChain != NULL) else if(master->PeerChain != NULL)
{ {