Commit 5aac6b74b400be119cda6c78dcc92a9df9197582

Con Kolivas 2013-11-22T23:40:22

Fix stack corruption of zeroing too much in bf1 driver.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/driver-bitfury.c b/driver-bitfury.c
index a54723a..fb6d44a 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -576,7 +576,7 @@ static int64_t bf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
 					  &amount, ms_diff, C_BF1_GETRES);
 	total += amount;
 	while (amount) {
-		usb_read_once_timeout(bitfury, readbuf + total, 512, &amount, 10,
+		usb_read_once_timeout(bitfury, readbuf + total, 512 - total, &amount, 10,
 				      C_BF1_GETRES);
 		total += amount;
 	};