From 6b01734ccf17de9f2dbc407841cc06e07f061e3f Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 9 Jan 2014 14:48:42 -0200 Subject: [PATCH] fix segfault in dhtget when ses is NULL (http://pastebin.com/rcJQm48W) --- src/twister.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/twister.cpp b/src/twister.cpp index c41a3b5d..443c07b3 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -1138,6 +1138,9 @@ Value dhtput(const Array& params, bool fHelp) "dhtput \n" "Store resource in dht network"); + if( !ses ) + return Value(); + EnsureWalletIsUnlocked(); string strUsername = params[0].get_str(); @@ -1181,6 +1184,9 @@ Value dhtget(const Array& params, bool fHelp) "dhtget \n" "Get resource from dht network"); + if( !ses ) + return Array(); + string strUsername = params[0].get_str(); string strResource = params[1].get_str(); string strMulti = params[2].get_str();