Skip to content

unix: wrong size check in uv_get_process_title() #2666

@bnoordhuis

Description

@bnoordhuis

libuv/src/unix/proctitle.c

Lines 113 to 116 in 9f1a052

if (size <= process_title.len) {
uv_mutex_unlock(&process_title_mutex);
return UV_ENOBUFS;
}

The check is wrong because process_title.len is the maximum capacity of the process title, not its current length.

Proper check: size <= strlen(process_title.str) except we probably don't want to call strlen() every time.

I'll open a PR with a fix.

Refs: nodejs/node#31633

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