diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-06-27 14:30:59 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2016-07-11 17:51:21 +0000 |
commit | f8dc769655959b290d70a2e66e2c3a625aa813cd (patch) | |
tree | 6a96d0efdb41cee5ff242b761422c28aea25662f | |
parent | 8cee6864c6718449e3b5bedcd79173391ec188e7 (diff) |
QMacTimeZonePrivate - correctly initialize m_nstz data-member
The default ctor never initializes m_nstz but calls init with
[NSTimeZone systemTimeZone].name. Init (re)sets m_nstz _only_
if this ianaId is in [NSTimeZone knownTimeZoneName], which is not guaranteed
(a good example is "US/Pacific" that can be returned by systemTimeZoneId() -
the similar problem is described in [*]. Set m_nstz to nil in ctor,
so if 'init' fails we still have a valid (nil) pointer.
[*] http://stackoverflow.com/questions/19819268/convert-ios-localtimezone-to-a-knowntimezone.
Task-number: QTBUG-54330
Change-Id: I68917926350aad3158d44a06f06721f25b3fdb74
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r-- | src/corelib/tools/qtimezoneprivate_mac.mm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/tools/qtimezoneprivate_mac.mm index f316fe0a6d..4e5034516b 100644 --- a/src/corelib/tools/qtimezoneprivate_mac.mm +++ b/src/corelib/tools/qtimezoneprivate_mac.mm @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE // Create the system default time zone QMacTimeZonePrivate::QMacTimeZonePrivate() + : m_nstz(0) { init(systemTimeZoneId()); } |