stability: replace sprintf with snprintf to avoid potential overflows
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
@@ -157,7 +157,7 @@ mraa_spi_init_raw(unsigned int bus, unsigned int cs)
|
||||
}
|
||||
|
||||
char path[MAX_SIZE];
|
||||
sprintf(path, "/dev/spidev%u.%u", bus, cs);
|
||||
snprintf(path, MAX_SIZE, "/dev/spidev%u.%u", bus, cs);
|
||||
|
||||
dev->devfd = open(path, O_RDWR);
|
||||
if (dev->devfd < 0) {
|
||||
|
||||
Reference in New Issue
Block a user