mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-05-18 11:35:34 +02: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_) {
|
if (!ptr_) {
|
||||||
ptr_ = std::unique_ptr<Array>(new Array());
|
ptr_ = std::unique_ptr<Array>(new Array());
|
||||||
}
|
}
|
||||||
|
// check comments array boundry.
|
||||||
|
if (slot < CommentPlacement::numberOfCommentPlacement) {
|
||||||
(*ptr_)[slot] = std::move(comment);
|
(*ptr_)[slot] = std::move(comment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Value::setComment(String comment, CommentPlacement placement) {
|
void Value::setComment(String comment, CommentPlacement placement) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user