Priority: P2: Important
Affects Version/s: 6.3
Fix Version/s: 6.3.0 Alpha
Component/s: Core: Date/Time
Environment:Ubuntu 20.04 LTS
Commits:c58a3a4aae4c423bd0477a981ad1c517a30579e3 (qt/qtbase/dev) a7d1c48ca3162a805708d059da87ca3d742863f1 (qt/qtbase/dev) 448e45b1f4cf9e4883c547d68312c469c79a9cd5 (qt/qtbase/6.2)
- Build the libfuzzer test for QDateTime::fromString, e.g.:
- Run the resulting binary, passing in the attached file:
It takes too long to finish. Times I see are:
developer build, debug, no sanitizers 9901 ms static, release, UBSAN 10293 ms static, release, ASAN 68568 ms
The slow formats seem to be Qt::TextDate and Qt::RFC2822Date.
I admit, the file is a tad larger than usual, but why would fromString() even try to handle all of this data?
With Qt 6.2.0 and this input, fromString() finishes quickly, e.g. in 35ms with ASAN.
Google's oss-fuzz found this as issue 38077. They will publish the details on December 2nd.
|For Gerrit Dashboard: QTBUG-97489|
|377114,3||QDateTime: Limit string processing to known boundaries||dev||qt/qtbase||Status: MERGED||+2||0|
|377130,7||QVarLengthArray: Reduce memory allocations in emplace()||dev||qt/qtbase||Status: MERGED||+2||0|
|378091,4||QVarLengthArray: Reduce memory allocations in insert()||6.2||qt/qtbase||Status: MERGED||+2||0|