Title: [8841] trunk/drivers/staging/iio/Documentation/iio_utils.h: iio-utils: fix memory overflow for alloced filename
Revision
8841
Author
bhsong
Date
2010-05-25 05:27:17 -0400 (Tue, 25 May 2010)

Log Message

iio-utils: fix memory overflow for alloced filename

Modified Paths


Diff

Modified: trunk/drivers/staging/iio/Documentation/iio_utils.h (8840 => 8841)


--- trunk/drivers/staging/iio/Documentation/iio_utils.h	2010-05-24 23:15:31 UTC (rev 8840)
+++ trunk/drivers/staging/iio/Documentation/iio_utils.h	2010-05-25 09:27:17 UTC (rev 8841)
@@ -62,10 +62,8 @@
 					1) != 0) {
 				filename = malloc(strlen(iio_dir)
 						+ strlen(type)
-						+ 1
 						+ numstrlen
-						+ 1
-						+ IIO_MAX_NAME_LENGTH);
+						+ 6);
 				if (filename == NULL)
 					return -ENOMEM;
 				sprintf(filename, "%s%s%d/name",
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to