[Mesa-dev] [Bug 33558] New: mesa uses of atof to parse glxserverversion harmfull for any of the non english sessions

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 26 14:48:56 PST 2011


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 at lists.freedesktop.org
        ReportedBy: prahal at 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.


More information about the mesa-dev mailing list