From: Barry Song <21cnbao@gmail.com> Date: Tue, 25 May 2010 09:40:04 +0000 (+0800) Subject: Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6ee30a27f8204d20aebe6e743e38d4b85ee753d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold filename Signed-off-by: Barry Song <21cnbao@gmail.com> Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index a4555e6f133f..014f6684faba 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h @@ -62,9 +62,8 @@ inline int find_type_by_name(const char *name, const char *type) 1) != 0) { filename = malloc(strlen(iio_dir) + strlen(type) - + 1 + numstrlen - + 1); + + 6); if (filename == NULL) return -ENOMEM; sprintf(filename, "%s%s%d/name",