mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 22:22:45 -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
1 changed files with 8 additions and 5 deletions
|
@ -545,6 +545,9 @@ uint32_t beMsgType(be_node *n)
|
||||||
#endif
|
#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))
|
if (beMsgMatchString(query, "ping", 4))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_MSG_TYPE
|
#ifdef DEBUG_MSG_TYPE
|
||||||
|
@ -804,10 +807,10 @@ int beMsgGetListStrings(be_node *n, std::list<std::string> &values)
|
||||||
for(int i = 0; n->val.l[i] != NULL; i++)
|
for(int i = 0; n->val.l[i] != NULL; i++)
|
||||||
{
|
{
|
||||||
be_node *val = n->val.l[i];
|
be_node *val = n->val.l[i];
|
||||||
if (val->type != BE_STR)
|
|
||||||
{
|
if (val == NULL || val->type != BE_STR)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
int len = be_str_len(val);
|
int len = be_str_len(val);
|
||||||
std::string str;
|
std::string str;
|
||||||
str.append(val->val.s, len);
|
str.append(val->val.s, len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue