Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Reallocation does not set new memory area to zero #7

@wusto

Description

@wusto

From realloc man page:
"If the new size is larger than the old size, the added memory will not be initialized."

data = realloc(data, sizeof(struct line_data)*line_data_buf);

As the first call is to calloc, this might lead to false assumptions when accessing the memory.

A possible solution is to memset the data buffer after realloc.

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