mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed soem other potential SIGSEGVs
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4065 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7c5f54d536
commit
01f4244f24
@ -543,7 +543,10 @@ uint32_t beMsgType(be_node *n)
|
||||
#ifdef DEBUG_MSG_TYPE
|
||||
std::cerr << "bsMsgType() QUERY MSG TYPE" << std::endl;
|
||||
#endif
|
||||
be_node *query = beMsgGetDictNode(n, "q");
|
||||
be_node *query = beMsgGetDictNode(n, "q");
|
||||
|
||||
if(query == NULL)
|
||||
return BITDHT_MSG_TYPE_UNKNOWN;
|
||||
|
||||
if (beMsgMatchString(query, "ping", 4))
|
||||
{
|
||||
@ -804,11 +807,11 @@ int beMsgGetListStrings(be_node *n, std::list<std::string> &values)
|
||||
for(int i = 0; n->val.l[i] != NULL; i++)
|
||||
{
|
||||
be_node *val = n->val.l[i];
|
||||
if (val->type != BE_STR)
|
||||
{
|
||||
|
||||
if (val == NULL || val->type != BE_STR)
|
||||
return 0;
|
||||
}
|
||||
int len = be_str_len(val);
|
||||
|
||||
int len = be_str_len(val);
|
||||
std::string str;
|
||||
str.append(val->val.s, len);
|
||||
values.push_back(str);
|
||||
|
Loading…
Reference in New Issue
Block a user