Skip to content

Sketchy sizeof after realloc in _evsignal_set_handler #14

@jruderman

Description

@jruderman

p = mm_realloc(sig->sh_old, new_max * sizeof(*sig->sh_old));

realloc(sig->sh_old, ...)

followed by

sizeof(*sig->sh_old)

might be undefined behavior.

I think it would be safer to write

const int element_size = sizeof(*sig->sh_old);

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