From: Thor Thayer <thor.tha...@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.tha...@linux.intel.com>
Signed-off-by: Meng Li <meng...@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

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to