You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure Json::Value::null{,Ref} are initialized at compile time.
This bug was introduced in commit 48d9a92.
gcc now puts Json::Value::null{,Ref} into bss section:
$ nm libjsoncpp.a | c++filt | grep Value::null
0000000000000000 B Json::Value::null
0000000000000008 B Json::Value::nullRef
When we access them in constructor of global objects, since the order of
initialization is unpredictable, we may dereference a null pointer.
After applying this patch, gcc puts them into rodata section:
$ nm libjsoncpp.a | c++filt | grep Value::null
0000000000000008 R Json::Value::null
0000000000000010 R Json::Value::nullRef
0 commit comments