forked from premiere/premiere-libtorrent
fixed unchecked input
This commit is contained in:
parent
9d426441f1
commit
6d7236fbea
|
@ -1,7 +1,7 @@
|
|||
AC_PREREQ(2.59)
|
||||
|
||||
AC_INIT(src/torrent.cpp)
|
||||
AM_INIT_AUTOMAKE(libtorrent, 0.9)
|
||||
AM_INIT_AUTOMAKE(libtorrent, 0.9.1)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
|
|
|
@ -1358,7 +1358,9 @@ namespace libtorrent
|
|||
|
||||
if (total_size > 500 * 1024)
|
||||
throw protocol_error("metadata size larger than 500 kB");
|
||||
if (offset > total_size)
|
||||
if (total_size <= 0)
|
||||
throw protocol_error("invalid metadata size");
|
||||
if (offset > total_size || offset < 0)
|
||||
throw protocol_error("invalid metadata offset");
|
||||
if (offset + data_size > total_size)
|
||||
throw protocol_error("invalid metadata message");
|
||||
|
|
Loading…
Reference in New Issue