mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed bug probably responsible for random crashes in DHT code
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5138 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
08e74f2dba
commit
16501f62dd
@ -209,7 +209,10 @@ static be_node *_be_decode(const char **data, long long *data_len)
|
|||||||
#ifdef BE_DEBUG_DECODE
|
#ifdef BE_DEBUG_DECODE
|
||||||
fprintf(stderr, "bencode::_be_decode() dictionary get val\n");
|
fprintf(stderr, "bencode::_be_decode() dictionary get val\n");
|
||||||
#endif
|
#endif
|
||||||
ret->val.d[i].val = _be_decode(data, data_len);
|
ret->val.d[i ].val = _be_decode(data, data_len);
|
||||||
|
ret->val.d[i+1].val = NULL ; // ensures termination of loops based on 0x0 value, otherwise, uninitialized
|
||||||
|
// memory occurs if(ret->val.d[i].key == 0x0 && ret->val.d[i].val != NULL)
|
||||||
|
// when calling be_free 8 lines below this point...
|
||||||
|
|
||||||
if ((ret->val.d[i].key == NULL) || (ret->val.d[i].val == NULL))
|
if ((ret->val.d[i].key == NULL) || (ret->val.d[i].val == NULL))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user