Summary: | use of locale atof to parse non localized values - segfault in cd-create-profile | ||
---|---|---|---|
Product: | colord | Reporter: | Alban Browaeys <prahal> |
Component: | client | Assignee: | Richard Hughes <richard> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Fixes use of atof in non "C" locale environments. |
Description
Alban Browaeys
2013-01-03 11:12:58 UTC
Good catch, thanks! I've decided to fix this another way, to use g_ascii_strtod which is locale independent and also allows us to check for parsing errors at the same time. I've committed this: commit 8d88b402fed63e6de1792801ca185b4f68b5edd0 Author: Richard Hughes <richard@hughsie.com> Date: Thu Jan 3 12:19:06 2013 +0000 Fix floating point number parsing in non C locale environments atof() is local dependant. Passing 1.0 to atof with in a French environment leads to segfault in lcms for create-standard-space as the primaries are all equal to 0 due to the dot not meaning decimal separator in this locale. Thus we get a null lcms profile from cmsCreateRGBProfile. Then as we pass this null profile to lcms, which results in a segfault. Many thanks to Alban Browaeys <prahal@yahoo.com> for debugging the problem. Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=58977 :100644 100644 71025be... d556cb0... M client/cd-create-profile.c :100644 100644 d70bd77... 386b4c5... M client/cd-fix-profile.c |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.