summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-04-13 14:22:00 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-14 17:56:31 +0000
commitfe0da2bb4f08ac8f8e7b268e8a2e1fdb98c57fcc (patch)
tree3c590df24ae6561997c864774e72ffc60e836674 /tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
parent6a4b3e861e1e191657181a74eeb4e60a52d12ca3 (diff)
Make POSIX transition rule parser more robust
The POSIX rule parser used by QTzTimeZonePrivate recklessly assumed that, if splitting the rule on a dot produced more than one part, it necessarily produced at least three. That's true for well-formed POSIX rules, but we should catch the case of malformed rules. Likewise, when calculating the dates of transitions, splitting the date rule on dots might produce too few fragments; and the fragments might not parse as valid numbers, or might be out of range for their respective fields in a date. Check all these cases, too. Added a test that crashed previously. Changed QTimeZone::offsetFromUtc() so that its "return zero on invalid" applies also to the case where the backend returns invalid, in support of this. Fixes: QTBUG-92808 Change-Id: Ica383a7a987465483341bdef8dcfd42edb6b43d6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit 964f91fd25a59654905c5a68d3cbccedab9ebb5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp')
0 files changed, 0 insertions, 0 deletions