#1168: reading past the end of KTorrent's pex added.f strings

This commit is contained in:
Charles Kerr
2008-08-10 14:58:11 +00:00
parent 822238ca33
commit 2e6443a53d
6 changed files with 36 additions and 25 deletions

View File

@@ -469,6 +469,23 @@ tr_bencDictFindStr( tr_benc * dict, const char * key, const char ** setme )
return found;
}
int
tr_bencDictFindRaw( tr_benc * dict,
const char * key,
const uint8_t ** setme_raw,
size_t * setme_len )
{
int found = FALSE;
tr_benc * child = tr_bencDictFindType( dict, key, TYPE_STR );
if( child ) {
*setme_raw = (uint8_t*) child->val.s.s;
*setme_len = child->val.s.i;
found = TRUE;
}
return found;
}
/***
****
***/