Skip to content

Commit 3f12417

Browse files
committed
Patch #3539678: Copy constructor does not initialize allocated_ for stringValue (contributed by rmongia).
1 parent f871585 commit 3f12417

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ New in SVN
3131
representable using an Int64, or asDouble() combined with minInt64 and
3232
maxInt64 to figure out whether it is approximately representable.
3333

34+
* Bug fixes
35+
- Patch #3539678: Copy constructor does not initialize allocated_ for stringValue
36+
(contributed by rmongia).
37+
38+
3439

3540
New in JsonCpp 0.6.0:
3641
---------------------

src/lib_json/json_value.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,10 @@ Value::Value( const Value &other )
470470
allocated_ = true;
471471
}
472472
else
473+
{
473474
value_.string_ = 0;
475+
allocated_ = false;
476+
}
474477
break;
475478
#ifndef JSON_VALUE_USE_INTERNAL_MAP
476479
case arrayValue:

0 commit comments

Comments
 (0)