[Fontconfig-bugs] [Bug 101348] New: fc-lang doesn't gracefully handle the case where the last language initial is < 'z'

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jun 8 13:54:35 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101348

            Bug ID: 101348
           Summary: fc-lang doesn't gracefully handle the case where  the
                    last language initial is < 'z'
           Product: fontconfig
           Version: 2.12
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: medium
         Component: library
          Assignee: fontconfig-bugs at lists.freedesktop.org
          Reporter: f.rougon at free.fr
        QA Contact: freedesktop at behdad.org

Created attachment 131801
  --> https://bugs.freedesktop.org/attachment.cgi?id=131801&action=edit
Fix as Git commit (obtained with 'git format-patch)

As reported at
https://lists.freedesktop.org/archives/fontconfig/2017-June/005940.html :

FcLangSetIndex() contains code like this:

  low = fcLangCharSetRanges[firstChar - 'a'].begin;
  high = fcLangCharSetRanges[firstChar - 'a'].end;
  /* no matches */
  if (low > high)

The assumption behind this test didn't hold before the attached
commit/patch, unless there is at least one language name that starts
with 'z' (which is thankfully the case in our world :-). If the last
language name in lexicographic order starts for instance with 'x',
this change ensures that fcLangCharSetRanges['y' - 'a'].begin and
fcLangCharSetRanges['z' - 'a'].begin are equal to NUM_LANG_CHAR_SET,
in order to make the above assumption correct in all cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20170608/c413d739/attachment.html>


More information about the Fontconfig-bugs mailing list