Lines 471-476
Link Here
|
471 |
BTFILE *pbf_last = (BTFILE*) 0; |
471 |
BTFILE *pbf_last = (BTFILE*) 0; |
472 |
BTFILE *pbf = (BTFILE*) 0; |
472 |
BTFILE *pbf = (BTFILE*) 0; |
473 |
size_t dl; |
473 |
size_t dl; |
|
|
474 |
unsigned long nfiles = 0; |
475 |
|
474 |
if( decode_query(metabuf,metabuf_len,"info|length", |
476 |
if( decode_query(metabuf,metabuf_len,"info|length", |
475 |
(const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ) |
477 |
(const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ) |
476 |
return -1; |
478 |
return -1; |
Lines 524-535
Link Here
|
524 |
#ifndef WINDOWS |
526 |
#ifndef WINDOWS |
525 |
if( !pbf ) return -1; |
527 |
if( !pbf ) return -1; |
526 |
#endif |
528 |
#endif |
|
|
529 |
nfiles++; |
527 |
pbf->bf_length = t; |
530 |
pbf->bf_length = t; |
528 |
m_total_files_length += t; |
531 |
m_total_files_length += t; |
529 |
r = decode_query(p, dl, "path", (const char **)0, &n, (int64_t*)0, |
532 |
r = decode_query(p, dl, "path", (const char **)0, &n, (int64_t*)0, |
530 |
QUERY_POS); |
533 |
QUERY_POS); |
531 |
if( !r ) return -1; |
534 |
if( !r || !decode_list2path(p + r, n, path, sizeof(path)) ){ |
532 |
if(!decode_list2path(p + r, n, path)) return -1; |
535 |
CONSOLE.Warning(1, |
|
|
536 |
"error, invalid path in torrent data for file %lu at offset %llu", |
537 |
nfiles, m_total_files_length - t); |
538 |
delete pbf; |
539 |
return -1; |
540 |
} |
533 |
|
541 |
|
534 |
int f_conv; |
542 |
int f_conv; |
535 |
char *tmpfn = new char[strlen(path)*2+5]; |
543 |
char *tmpfn = new char[strlen(path)*2+5]; |