Browse Source

Bugfix: bitforce: Allocate enough space for FTDI description pointers

Alloca that needs the dthe size in bytes rather than elements.
Luke Dashjr 13 years ago
parent
commit
71bbd583e0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      driver-bitforce.c

+ 1 - 1
driver-bitforce.c

@@ -175,7 +175,7 @@ static int bitforce_autodetect_ftdi(void)
 	applog(LOG_DEBUG, "FTDI reports %u devices", (unsigned)numDevs);
 
 	buf = alloca(65 * numDevs);
-	bufptrs = alloca(numDevs + 1);
+	bufptrs = alloca(sizeof(*bufptrs) * (numDevs + 1));
 
 	for (i = 0; i < numDevs; ++i)
 		bufptrs[i] = &buf[i * 65];