mirror of
https://github.com/torvalds/linux.git
synced 2024-12-16 16:12:52 +00:00
staging: fbtft: Fix buffer overflow vulnerability
Module copies a user supplied string (module parameter) into a buffer using strncpy() and does not check that the buffer is null terminated. Replace call to strncpy() with call to strlcpy() ensuring that the buffer is null terminated. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ca5af1f303
commit
8414fe11ba
@ -1483,7 +1483,7 @@ static int __init fbtft_device_init(void)
|
||||
displays[i].pdev->name = name;
|
||||
displays[i].spi = NULL;
|
||||
} else {
|
||||
strncpy(displays[i].spi->modalias, name, SPI_NAME_SIZE);
|
||||
strlcpy(displays[i].spi->modalias, name, SPI_NAME_SIZE);
|
||||
displays[i].pdev = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user