mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
usbutils saving incorrect overflow buffer
This commit is contained in:
parent
68c6a12b26
commit
0e8028fc29
@ -2757,7 +2757,7 @@ int _usb_read(struct cgpu_info *cgpu, int epinfo, char *buf, size_t bufsiz, int
|
|||||||
// N.B. usbdev->buffer was emptied before the while() loop
|
// N.B. usbdev->buffer was emptied before the while() loop
|
||||||
if (usbdev->buffer && tot > (int)bufsiz) {
|
if (usbdev->buffer && tot > (int)bufsiz) {
|
||||||
usbdev->bufamt = tot - bufsiz;
|
usbdev->bufamt = tot - bufsiz;
|
||||||
memcpy(usbdev->buffer, ptr + bufsiz, usbdev->bufamt);
|
memcpy(usbdev->buffer, usbbuf + bufsiz, usbdev->bufamt);
|
||||||
tot -= usbdev->bufamt;
|
tot -= usbdev->bufamt;
|
||||||
usbbuf[tot] = '\0';
|
usbbuf[tot] = '\0';
|
||||||
applog(LOG_ERR, "USB: %s%i read1 buffering %d extra bytes",
|
applog(LOG_ERR, "USB: %s%i read1 buffering %d extra bytes",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user