8000 heap_insert unsafe · Issue #1563 · joyent/libuv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 4, 2018. It is now read-only.
This repository was archived by the owner on May 4, 2018. It is now read-only.
heap_insert unsafe #1563
Open
Open
@scunningham

Description

@scunningham

Although understandably an edge case, heap_insert should fail to insert a new node if heap->nelts == UINT_MAX.

It is possible, though unlikely, that unsigned int is 16 bit. Even in a 32 bit world, hitting UINT_MAX becomes more likely as machines get faster.

At the very least it should assert(heap->nelts < UINT_MAX). It would be better to abort() than blindly corrupt the data structure.

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

      0