From d31d1ca664b68d16590c2d4ed12ae9db5a3a6ffe Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 15 Feb 2015 17:40:46 +0100 Subject: [PATCH] fix of the fix --- src/json.hpp | 2 +- src/json.hpp.re2c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 08925890e..880b4229c 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -3423,7 +3423,7 @@ basic_json_parser_59: if (codepoint >= 0xD800 and codepoint <= 0xDBFF) { // make sure there is a subsequent unicode - if (m_cursor - i < 11 and * (i + 5) == '\\' and * (i + 6) == 'u') + if ((i + 6 >= m_limit) or * (i + 5) != '\\' or * (i + 6) != 'u') { throw std::invalid_argument("missing low surrogate"); } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 1aa5b94e3..d8ef4107f 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -2772,7 +2772,7 @@ class basic_json if (codepoint >= 0xD800 and codepoint <= 0xDBFF) { // make sure there is a subsequent unicode - if (m_cursor - i < 11 and * (i + 5) == '\\' and * (i + 6) == 'u') + if ((i + 6 >= m_limit) or * (i + 5) != '\\' or * (i + 6) != 'u') { throw std::invalid_argument("missing low surrogate"); }