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

           Summary: mesa uses of atof to parse glxserverversion harmfull
                    for any of the non english sessions
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: medium
         Component: GLX
        AssignedTo: mesa-dev@lists.freedesktop.org
        ReportedBy: pra...@yahoo.com


Created an attachment (id=42563)
 View: https://bugs.freedesktop.org/attachment.cgi?id=42563
 Review: https://bugs.freedesktop.org/review?bug=33558&attachment=42563

workaround atof behing feed non localized data thus preventing glx 1.4 codepath
use

In src/glx/glxext.c at least for french users if (atof(priv->serverGLXversion)
>= 1.3) { always leads to false as priv->serverGLXVersion is "1.4" etc and in
locales that uses comma as the decimal separator instead of dot as for english
speakers "1.4" becomes "1" via atof instead of 1.4 the double.

I made a small hack using setlocale to set LC_ALL to C before atof call and
restore it afterwards. We may not want to bail out if the saved_locale is null
(out of memory).

I have been told other places uses atof in mesa, the others places that does so
with the same string (serverGLXVersion) is:
src/gallium/state_trackers/egl/x11/glxinit.c

I do not know if the other are feed with data localized or need to be protected
like the previous ones.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to