From 796a88a9525bf5765ec937ba9dd17350895c8121 Mon Sep 17 00:00:00 2001 From: absolutelightning Date: Tue, 4 Jul 2023 10:17:37 +0530 Subject: [PATCH] check size of written json --- command/connect/envoy/exec_windows.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/command/connect/envoy/exec_windows.go b/command/connect/envoy/exec_windows.go index 72589e772f..7b5bd951bd 100644 --- a/command/connect/envoy/exec_windows.go +++ b/command/connect/envoy/exec_windows.go @@ -42,11 +42,15 @@ func makeBootstrapPipe(bootstrapJSON []byte) (string, error) { } // Write the config - _, err = pipeConn.Write(bootstrapJSON) + n, err = pipeConn.Write(bootstrapJSON) if err != nil { return pipeFile, err } + if n < len(bootstrapJSON) { + return pipeFile, fmt.Errorf("failed writing boostrap to child STDIN: %s", err) + } + // We can't wait for the process since we need to exec into Envoy before it // will be able to complete so it will be remain as a zombie until Envoy is // killed then will be reaped by the init process (pid 0). This is all a bit