Skip to content

FileStat size integer overflow #705

Description

@haxiomic

sys.FileSystem.stat(path).size returns a negative number for a file more than 2.1 GB long

The problem is all values from stat are cast to 4 byte int:
STATF(size); Sys.cpp#L410
#define STATF(f) o->Add(HX_CSTRING(#f),(int)(s.st_##f)) Sys.cpp#L369

(also mode is set twice)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions