summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkcookie.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 286c5f6..4846618 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -662,7 +662,8 @@ static QDateTime parseDateString(const QByteArray &dateString)
|| (dateString[at - 1] == 't'))) {
int end = 1;
- while (end < 5 && dateString[at + end] >= '0' && dateString[at + end] <= '9')
+ while (end < 5 && dateString.length() > at+end
+ && dateString[at + end] >= '0' && dateString[at + end] <= '9')
++end;
int minutes = 0;
int hours = 0;
@@ -736,7 +737,7 @@ static QDateTime parseDateString(const QByteArray &dateString)
// Could be month, day or year
if (isNum) {
int length = 1;
- if (dateString.length() >= at + 1
+ if (dateString.length() > at + 1
&& isNumber(dateString[at + 1]))
++length;
int x = atoi(dateString.mid(at, length).constData());