[CONC-46] Issue with setlocale Created: 2013-08-14 Updated: 2013-08-14 Resolved: 2013-08-14 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Vishal PR | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS: Windows 8 Professional 64-bit |
||
| Description |
|
In source file my_init.c, there is a call setlocale(LC_CTYPE, ""); /* To get right sortorder */ This will eventually set the locale to system locale. C run-time functions uses this information for validating/comparing parameters. In my understanding this is dangerous thing to do for a UTF-8 client. As UTF-8 doesnt depend on any locale, the passed string might have some character sequence that the string functions consider improper. This is resulting in exception. I checked the mariadbclient source and couldn't find any relevent functions which uses strcmp and depends on locale. So I think it is not doing anything the comment says, correct me if I am wrong. On a side note I believe MariaDB client shouldn't have set the locale on the whole, it should have rather used the locale enabled versions of string functions for its internal use. |
| Comments |
| Comment by Georg Richter [ 2013-08-14 ] |
|
Fixed in rev. 79 |