Skip to content

possible infinite loop in sys::windows::fill_utf16_buf #73212

Closed
@rkuhn

Description

@rkuhn

Looking at the code without prior knowledge of Windows system call semantics, I see an infinite loop if the syscall were to fill up the buffer exactly: when k == n on line 195, the loop will be rerun with no changes, which should result in the exact same outcome if the syscall is idempotent.

Even if Windows guarantees in some way that this cannot happen, would it not be clearer to handle this case in an obvious fashion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions