Skip to content

Check calloc return value in csrc/addon.cc to avoid NULL pointer dereference #94

@grgalex

Description

@grgalex

We don't check the return value of calloc [1], which can be NULL if the allocation fails.

This can lead to a Segmentation Fault when we later try to write to the result buffer [2].

[1]

char* output_data = (char*) calloc(max_output_length, 1);

[2]

StoreU32(kWoff2Signature, &offset, result);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions