diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-08-24 11:55:35 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-08-25 12:45:50 +0000 |
commit | de7f281d7ad1bc8e3dc5a549436a8cb3ba159e7f (patch) | |
tree | 8adcf28a9b4590a14a97dd52b8da6ada7e6db612 /src/corelib | |
parent | 3f64156e918a8cf5da1b68191a280f0daf3d954b (diff) |
QLocale: Fix wrong assert
The endptr from reading the exponent of a 'g' form snprintf result
should not be past the end of the string we're reading from. It has
nothing to do with the 'e' sign.
Task-number: QTBUG-54482
Change-Id: I8bdee917b8d21fdc94c255548ad7e008431a07fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qlocale_tools.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp index 5fd2aa0c59..762f4f36dc 100644 --- a/src/corelib/tools/qlocale_tools.cpp +++ b/src/corelib/tools/qlocale_tools.cpp @@ -224,7 +224,7 @@ void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char * const char *endptr; decpt = qstrtoll(target.data() + eSign + 1, &endptr, 10, &ok) + 1; Q_ASSERT(ok); - Q_ASSERT(endptr - target.data() <= length - eSign -1); + Q_ASSERT(endptr - target.data() <= length); } else { // No 'e' found, so it's the 'f' form. Variants of snprintf generate numbers with // potentially multiple digits before the '.', but without decimal exponent then. So we |