2
0
mirror of synced 2025-02-24 06:38:14 +00:00

Fix crash from bad metadata_size in extended handshake

This commit is contained in:
Matt Joiner 2015-03-24 16:46:34 +11:00
parent ecda836926
commit 03e69c5464

View File

@ -346,7 +346,7 @@ func (t *torrent) setMetadataSize(bytes int64) {
if t.MetaData != nil {
return
}
if bytes > 10000000 { // 10MB, pulled from my ass.
if bytes <= 0 || bytes > 10000000 { // 10MB, pulled from my ass.
return
}
t.MetaData = make([]byte, bytes)