[linux-yocto] [PATCH 06/25] FogBugz #532583-2: hwmon: Fix buffer calls for SDL compliance.
Meng.Li at windriver.com
Meng.Li at windriver.com
Tue Apr 3 19:37:29 PDT 2018
From: Thor Thayer <thor.thayer at linux.intel.com>
commit b899ea69f0346f24ef238bcb248bde51dc639ea2 from
https://github.com/altera-opensource/linux-socfpga.git
The buffer calls need to be more secure so pass the buffer size
in the sprintf functions. Limit buffer size to 5.
Signed-off-by: Thor Thayer <thor.thayer at linux.intel.com>
Signed-off-by: Meng Li <Meng.Li at windriver.com>
---
drivers/hwmon/altera-a10sr-hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/altera-a10sr-hwmon.c b/drivers/hwmon/altera-a10sr-hwmon.c
index dac39a7..584cc48 100644
--- a/drivers/hwmon/altera-a10sr-hwmon.c
+++ b/drivers/hwmon/altera-a10sr-hwmon.c
@@ -126,7 +126,7 @@ static ssize_t altr_a10sr_read_status(struct device *dev,
else
val = !!(val & mask);
- return sprintf(buf, "%d\n", val);
+ return scnprintf(buf, 5, "%d\n", val);
}
static ssize_t set_enable(struct device *dev,
--
1.7.9.5
More information about the linux-yocto
mailing list