[Fontconfig-bugs] [Bug 96676] Check range of FcWeightFromOpenType argument.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jun 30 02:54:16 UTC 2016


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

Akira TAGOH <akira at tagoh.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akira at tagoh.org

--- Comment #2 from Akira TAGOH <akira at tagoh.org> ---
I guess this may be what you prefer right?

diff --git a/src/fcweight.c b/src/fcweight.c
index 1a3b608..036a518 100644
--- a/src/fcweight.c
+++ b/src/fcweight.c
@@ -75,6 +75,7 @@ FcWeightFromOpenType (int ot_weight)
                case 9: ot_weight = 900; break;
            }
        }
+       ot_weight = FC_MIN (ot_weight, map[(sizeof (map) / sizeof (map[0])) -
1].ot);

        for (i = 1; ot_weight > map[i].ot; i++)
          ;

-- 
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/20160630/ec7e34ec/attachment.html>


More information about the Fontconfig-bugs mailing list