diff --git a/source3/rpc_client/rpc_transport_smbd.c b/source3/rpc_client/rpc_transport_smbd.c index efc57eb2431..d8ab96f7b2c 100644 --- a/source3/rpc_client/rpc_transport_smbd.c +++ b/source3/rpc_client/rpc_transport_smbd.c @@ -88,6 +88,7 @@ static void rpc_cli_smbd_stdout_reader(struct event_context *ev, TALLOC_FREE(fde); return; } + buf[nread] = '\0'; if (conn->stdout_callback.fn != NULL) { conn->stdout_callback.fn(buf, nread,