Skip to content

minor error handling issues in cat #10016

@sylvestre

Description

@sylvestre

Component

cat

Description

(1) When processing the return value of read, write_fast catches errors, while write_lines silently swallows them. This results in normal return even if read fails.

(2) During writing, the execution result of write is captured in some places while unwrap() is directly called in others, which may trigger an abort when writing fails.

Test / Reproduction Steps

It is triggered in extreme cases where read/write operations fail.

Impact

When a read error occurs, the error is silently swallowed; when a write error occurs, it triggers a crash.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions