From 831b1aad6f2252f0f2ec672f201f42826e31130b Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Tue, 24 Sep 2024 20:22:37 +0900 Subject: [PATCH] helper/args: hold a read lock in WriteTo Signed-off-by: Ophestra Umiker --- helper/args.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper/args.go b/helper/args.go index bbb66f0..8ef07f4 100644 --- a/helper/args.go +++ b/helper/args.go @@ -62,6 +62,9 @@ func (a *argsFD) Seal(args []string) error { } func (a *argsFD) WriteTo(w io.Writer) (int64, error) { + a.RLock() + defer a.RUnlock() + if a.seal == nil { panic("attempted to activate unsealed args") }