Only check strlen on end if end exists.
diff --git a/usbutils.c b/usbutils.c
index 1974cad..ee8e713 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2522,12 +2522,15 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
unsigned int initial_timeout;
int bufleft, err, got, tot, pstate;
bool first = true;
- int endlen = strlen(end);
+ int endlen = 0;
unsigned char *ptr, *usbbuf = cgpu->usbinfo.bulkbuf;
const size_t usbbufread = 512; /* Always read full size */
char *eom = NULL;
double done;
+ if (end)
+ endlen = strlen(end);
+
DEVRLOCK(cgpu, pstate);
if (cgpu->usbinfo.nodev) {