Skip to content

Null pointer dereference on malloc failure in freenect_init_registration_table() #699

@hirorogo

Description

@hirorogo

Summary

freenect_init_registration_table() in src/registration.c does not check the return value of malloc() before passing the pointer to memset(). If malloc() fails and returns NULL, memset(NULL, ...) causes a null pointer dereference crash.

Location

src/registration.c, inside freenect_init_registration_table() — the malloc() call for the registration table buffer.

Impact

An application that initializes Freenect registration under memory pressure will crash with a segmentation fault (denial of service).

Fix

PR #698 adds a NULL check after malloc() and returns an error code on failure.

Related

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