diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2019-09-17 07:35:26 -0700 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-10-09 20:08:48 +0200 |
commit | f2e9505aa164f851ff4e121a209c9f9ae52041ae (patch) | |
tree | b1f3b0c5fe011afc7973db06c53c361edeadbcf0 /configure.json | |
parent | 41e59afc4129260f783553777ef8a2092df1192c (diff) |
Filesystem: avoid crashes on exit in case the locale codec is null
On exit, QLocale::codecForLocale() can return null as the codec may have
already been destroyed. In that case, pretend that Latin1 was the
locale, so any file name is acceptable. This matches QString:
QTextCodec *codec = QTextCodec::codecForLocale();
if (codec)
return codec->toUnicode(str, size);
#endif // textcodec
return fromLatin1(str, size);
Note that if we're wrong and the locale was *not* Latin1, files that you
had a name to may not be encoded or decoded the same way.
Fixes: QTBUG-78446
Change-Id: Iece6e011237e4ab284ecfffd15c54077728a17ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 70e6e9fe590590f602dee230a64870365d9301aa)
Diffstat (limited to 'configure.json')
0 files changed, 0 insertions, 0 deletions