Made deserializeJson() more picky about trailing characters (closes #980)

This commit is contained in:
Benoit Blanchon
2019-05-16 20:41:07 +02:00
parent 2af003e4e2
commit 90c1d549a8
12 changed files with 98 additions and 85 deletions

View File

@@ -134,17 +134,10 @@ class MsgPackDeserializer {
// Prevent VS warning "assignment operator could not be generated"
MsgPackDeserializer &operator=(const MsgPackDeserializer &);
bool skip(uint8_t n) {
while (n--) {
if (_reader.ended()) return false;
_reader.read();
}
return true;
}
bool readByte(uint8_t &value) {
if (_reader.ended()) return false;
value = static_cast<uint8_t>(_reader.read());
int c = _reader.read();
if (c < 0) return false;
value = static_cast<uint8_t>(c);
return true;
}