snowyu / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
1 stars 0 forks source link

Debug log problem and maybe others caused by lt_tex #569

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add info hash with all bits zero to the session (could be other hashs too)
2. Wait for other clients to send you invalid trackers via lt_tex
   (DHT will find them)
3. At least on Windows character sequence like ..%n.. will generate  runtime 
errors if libtorrent tries to log those strings (urls)

What version of the product are you using? On what operating system?
Windows
libtorrent trunk

Please provide any additional information below.

I added some sanity filtering in lt_tex. (limited url length and use only 10 
from one message and exclude every url which includes %).
None the less in a short amount of time i got >1900 (mostly invalid) tracker 
urls for this torrent.
Dunno if this just a flaw in libtorent or an intended attack.

This number of trackers also creates a unexpected delay in 
prioritize_udp_trackers() at startup.

Original issue reported on code.google.com by webmas...@massaroddel.de on 25 Jan 2014 at 5:01

GoogleCodeExporter commented 9 years ago
thanks for the report. I've fixed this in RC_0_16 and trunk

Original comment by arvid.no...@gmail.com on 26 Jan 2014 at 1:18

GoogleCodeExporter commented 9 years ago
I didn't reproduce the runtime error on windows you mentioned though. What 
operation failed exactly?

Original comment by arvid.no...@gmail.com on 26 Jan 2014 at 1:18

GoogleCodeExporter commented 9 years ago
This problem occurs whenever a (bad) announce url gets logged.
ie: torrent.cpp 2285 (trunk 9601)
actual problem is in
torrent_debug_log() vsnprintf(usr, sizeof(usr), fmt, v);
Runtime Error: "'n' format specifier disabled"

here is an example i got via lt_tex:
url="udp://tracker.istole.it:80/annou~ce8| ý€ }»%net lia] heÓ¥ .dÂ"

Original comment by webmas...@massaroddel.de on 26 Jan 2014 at 8:44

GoogleCodeExporter commented 9 years ago
thanks. I've fixed this too

Original comment by arvid.no...@gmail.com on 26 Jan 2014 at 9:18