Commit b8448666 authored by Erik Sjölund's avatar Erik Sjölund

require at least 4 more bytes after \u during JSON parsing

parent b820678d
......@@ -616,6 +616,7 @@ public:
case 't' : decoded.add('\t'); advance(); break;
case 'u' :
advance(); // consume 'u'
KJ_REQUIRE(remaining.size() >= 4, "JSON message ends prematurely.");
unescapeAndAppend(kj::arrayPtr(remaining.begin(), 4), decoded);
advance(4);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment