Skip to content

Commit f251f15

Browse files
authored
Fix crash issue due to NULL value.
Null value in Value constructor will crash strlen(). Avoid crash with JSON_ASSERT_MESSAGE
1 parent 8106574 commit f251f15

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib_json/json_value.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ Value::Value(double value) {
398398

399399
Value::Value(const char* value) {
400400
initBasic(stringValue, true);
401+
JSON_ASSERT_MESSAGE(value != NULL, "Null Value Passed to Value Constructor");
401402
value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));
402403
}
403404

0 commit comments

Comments
 (0)