fix crash by iomeone · Pull Request #2 · wang70937/JsModule · GitHub
Skip to content

fix crash#2

Open
iomeone wants to merge 1 commit into
wang70937:masterfrom
iomeone:patch-1
Open

fix crash#2
iomeone wants to merge 1 commit into
wang70937:masterfrom
iomeone:patch-1

Conversation

@iomeone

@iomeone iomeone commented Aug 15, 2019

Copy link
Copy Markdown
var vRet = curl.post("192.168.35.99", "http://192.168.35.99:3000/queryMsg/query", "_trunc=-1&_limit=10", 0, 1);
//parse
var vRoot = json.parse(vRet);
//IsValid

if(vRoot.IsValid()) can cause crash when 192.168.35.99 is unreachable.
so we need check v as follows in json.cpp

v8::Handle<v8::Value> v = v8pp::json_parse(m_isolate, m_str);
if (v.IsEmpty())
return false;

var vRet = curl.post("192.168.35.99", "http://192.168.35.99:3000/queryMsg/query", "_trunc=-1&_limit=10", 0, 1);
//parse
var vRoot = json.parse(vRet);
//IsValid
if(vRoot.IsValid()) can cause crash when 192.168.35.99 is unreachable.
so we need check v as follows in json.cpp
v8::Handle<v8::Value> v = v8pp::json_parse(m_isolate, m_str);
if (v.IsEmpty())
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant