mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-28 00:36:02 +02:00
Merge pull request #141 from cdunn2001/set-comment
Fix a border case which causes Value::CommentInfo::setComment() to crash
This commit is contained in:
commit
7312b1022d
@ -142,8 +142,10 @@ Value::CommentInfo::~CommentInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Value::CommentInfo::setComment(const char* text) {
|
void Value::CommentInfo::setComment(const char* text) {
|
||||||
if (comment_)
|
if (comment_) {
|
||||||
releaseStringValue(comment_);
|
releaseStringValue(comment_);
|
||||||
|
comment_ = 0;
|
||||||
|
}
|
||||||
JSON_ASSERT(text != 0);
|
JSON_ASSERT(text != 0);
|
||||||
JSON_ASSERT_MESSAGE(
|
JSON_ASSERT_MESSAGE(
|
||||||
text[0] == '\0' || text[0] == '/',
|
text[0] == '\0' || text[0] == '/',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user