Fix crash when using empty V8 strings with bindings (issue #1015).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1308 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-07-18 18:09:09 +00:00
parent 27fac646d9
commit 575cdbbd31
2 changed files with 94 additions and 1 deletions

View File

@ -1276,9 +1276,12 @@ void CefV8ValueImpl::InitString(CefString& value) {
const cef_string_t* str = value.GetStruct();
if (str) {
string_value_ = *str;
value.GetWritableStruct()->str = NULL;
cef_string_t* writable_struct = value.GetWritableStruct();
writable_struct->str = NULL;
writable_struct->length = 0;
} else {
string_value_.str = NULL;
string_value_.length = 0;
}
}