shithub: riscv

Download patch

ref: 7c3477cb616677a1e886373af4b929d7f3497729
parent: 86a77e5088d11c5921d735b14d83441d0fc9d2bc
author: cinap_lenrek <[email protected]>
date: Fri Jun 19 16:19:57 EDT 2020

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

--- a/sys/src/cmd/ip/torrent.c
+++ b/sys/src/cmd/ip/torrent.c
@@ -295,7 +295,7 @@
 			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 |