Skip to content

hooks: missing defensive copy in outputTail.String() append #14110

Description

@glours

This issue was filed by an AI agent on a human's behalf. The human submitter may not have independently verified the report.

In outputTail.String() (hook.go, PR #14091), the partial-line append uses the lines slice directly:

lines = append(lines, partial)

Without a defensive copy this can mutate the underlying array if the slice has spare capacity. The original code used append(append([]string{}, lines...), partial). Low impact in practice (the function is called after the copy goroutine has exited), but fragile.

Mentioned in #14091 review by @ndeloof (hook.go:221).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions