From df25927a6827c0abce6d35440359a835d23226f7 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 5 Sep 2014 13:26:16 +0200 Subject: Don't accept json strings with trailing garbage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A well formed JSON document is not allowed to contain trailing garbage at the end. Don't accept this in the parser. Task-number: QTBUG-40062 Change-Id: I0a09dbd099a8c643f58023342546c4e67d026fec Reviewed-by: Jędrzej Nowacki --- src/corelib/json/qjsondocument.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/json/qjsondocument.h') diff --git a/src/corelib/json/qjsondocument.h b/src/corelib/json/qjsondocument.h index ea42d76b20..a09176727f 100644 --- a/src/corelib/json/qjsondocument.h +++ b/src/corelib/json/qjsondocument.h @@ -68,7 +68,8 @@ struct Q_CORE_EXPORT QJsonParseError UnterminatedString, MissingObject, DeepNesting, - DocumentTooLarge + DocumentTooLarge, + GarbageAtEnd }; QString errorString() const; -- cgit v1.2.3