Skip to content

malloc return value unchecked in utmp_db_add #124

Description

@QiuYitai

malloc return value is unchecked at tools/ids.c:85-93. If malloc fails, new->idle = idle dereferences NULL.

new = malloc(sizeof *new);
new->idle = idle;     // new==NULL → SIGSEGV

Fix: Add NULL check after malloc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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