ip/torrent: fix size check in 64-bit "v" unpack (thanks pr)

This commit is contained in:
cinap_lenrek 2020-06-19 20:19:57 +02:00
parent 86a77e5088
commit 7c3477cb61

View file

@ -295,7 +295,7 @@ unpack(uchar *s, int n, char *fmt, ...)
s += 4;
break;
case 'v':
if(s+4 > e) goto Err;
if(s+8 > e) goto Err;
*va_arg(arg, vlong*) =
(vlong)s[0]<<56 |
(vlong)s[1]<<48 |