mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-04-27 10:25:58 +02:00
rejectDupKeys
This commit is contained in:
parent
527332d5d5
commit
62ad140d18
@ -1432,6 +1432,11 @@ bool OurReader::readObject(Token& tokenStart) {
|
|||||||
"Missing ':' after object member name", colon, tokenObjectEnd);
|
"Missing ':' after object member name", colon, tokenObjectEnd);
|
||||||
}
|
}
|
||||||
if (name.length() >= (1U<<30)) throw std::runtime_error("keylength >= 2^30");
|
if (name.length() >= (1U<<30)) throw std::runtime_error("keylength >= 2^30");
|
||||||
|
if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
|
||||||
|
std::string msg = "Duplicate key: '" + name + "'";
|
||||||
|
return addErrorAndRecover(
|
||||||
|
msg, tokenName, tokenObjectEnd);
|
||||||
|
}
|
||||||
Value& value = currentValue()[name];
|
Value& value = currentValue()[name];
|
||||||
nodes_.push(&value);
|
nodes_.push(&value);
|
||||||
bool ok = readValue();
|
bool ok = readValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user