Skip to content

[SR-1548] Endianness issues in CFString.h  #4350

Closed
@swift-ci

Description

@swift-ci
Previous ID SR-1548
Radar None
Original Reporter vivkong (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Linux on System z

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee vivkong (JIRA)
Priority Medium

md5: 25030752a24549b95d833caf12696d70

Issue Description:

In CFSTR(cStr), the 32-bit _length field is aliased with __CFString.notInlineImmutable1.length which is a signed long. This is incorrect on Linux on System z (big endian) where long is 8 bytes (64 bits) long. The length value will be padded on the right which works on little endian but it is 2^32 times larger than it should be on big endian system.

Also on big endian system, CFSTR(cStr) should initialize _base._cfinfo with {0x00, 0x00, 0x07, 0xc8}.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions