helper/args: hold a read lock in WriteTo

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-09-24 20:22:37 +09:00
parent be83ad838c
commit 831b1aad6f
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ func (a *argsFD) Seal(args []string) error {
} }
func (a *argsFD) WriteTo(w io.Writer) (int64, error) { func (a *argsFD) WriteTo(w io.Writer) (int64, error) {
a.RLock()
defer a.RUnlock()
if a.seal == nil { if a.seal == nil {
panic("attempted to activate unsealed args") panic("attempted to activate unsealed args")
} }