mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-13 10:22:55 +01:00
Check the comments array boundry. (#993)
* check the comments array boundry * remove empty line
This commit is contained in:
parent
db61dba885
commit
d622250c3e
@ -1450,7 +1450,10 @@ void Value::Comments::set(CommentPlacement slot, String comment) {
|
||||
if (!ptr_) {
|
||||
ptr_ = std::unique_ptr<Array>(new Array());
|
||||
}
|
||||
(*ptr_)[slot] = std::move(comment);
|
||||
// check comments array boundry.
|
||||
if (slot < CommentPlacement::numberOfCommentPlacement) {
|
||||
(*ptr_)[slot] = std::move(comment);
|
||||
}
|
||||
}
|
||||
|
||||
void Value::setComment(String comment, CommentPlacement placement) {
|
||||
|
Loading…
Reference in New Issue
Block a user