Code: xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *pstr)
{
    /* This function is copied verbatim from plfont.c */

    int table_length;
     int table_offset;
 
     ulong format;
    uint numGlyphs;
     uint glyph_name_index;
     const byte *postp; /* post table pointer */
 
     /* guess if the font type is not truetype */
     if ( pfont->FontType != ft_TrueType )
     {
            pstr->size = strlen((char*)pstr->data);
            return 0;
        }
        else
        {
            return gs_throw1(-1, "glyph index %lu out of range", (ulong)glyph);
        }
    }

Vulnerability Type: DoS Overflow
CWE ID: CWE-119
Summary: The xps_true_callback_glyph_name function in xps/xpsttf.c in Artifex Ghostscript GhostXPS 9.21 allows remote attackers to cause a denial of service (Segmentation Violation and application crash) via a crafted file.
Commit Message: 