Skip to content

DecodeMacRoman() is missing an upper bounds check before indexing into Mac2Unicode array #891

Closed
@ddkilzer

Description

@ddkilzer

DecodeMacRoman() is missing an upper bounds check before indexing into the Mac2Unicode array:

/* Function to convert from MacRoman to Unicode */
uint TY_(DecodeMacRoman)(uint c)
{
    if (127 < c)
        c = Mac2Unicode[c - 128];
    return c;
}

It should do this instead, like DecodeIbm850() does:

    if (127 < c && c < 256)
        c = Mac2Unicode[c - 128];
    return c;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions