Skip to content

free is Called on Arrays not Allocated by malloc #14

@heshuimu

Description

@heshuimu

tarkit/DCTar.m

Line 442 in 62d1c23

char buffer[TAR_BLOCK_SIZE];

tarkit/DCTar.m

Lines 454 to 459 in 62d1c23

char nameChar[USTAR_name_size];
[self writeString:path toChar:nameChar withLength:USTAR_name_size];
char unameChar[USTAR_uname_size];
[self writeString:ownerName toChar:unameChar withLength:USTAR_uname_size];
char gnameChar[USTAR_gname_size];
[self writeString:groupName toChar:gnameChar withLength:USTAR_gname_size];

tarkit/DCTar.m

Lines 507 to 510 in 62d1c23

free(buffer);
free(nameChar);
free(unameChar);
free(gnameChar);

This causes runtime exceptions at least on iOS 12. There are several other places where free is called like this, the code snippet above is just an example.

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