From 85c380ca6e89b464213e5b990f3a3783856c1dd8 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Thu, 30 Oct 2014 12:48:56 +0300 Subject: [PATCH] Fix Issue #285 Fix case of msg is successfully "bdecoded", but it is not lazy_entry dictionary actually. --- src/twister.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/twister.cpp b/src/twister.cpp index f4f73ec5..5f0faadc 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -1090,7 +1090,8 @@ bool processReceivedDM(lazy_entry const* post) lazy_entry v; int pos; libtorrent::error_code ec; - if (lazy_bdecode(textOut.data(), textOut.data()+textOut.size(), v, ec, &pos) == 0) { + if (lazy_bdecode(textOut.data(), textOut.data()+textOut.size(), v, ec, &pos) == 0 + && v.type() == lazy_entry::dict_t) { msg = v.dict_find_string_value("msg"); to = v.dict_find_string_value("to"); // new features here: key distribution etc