Commit 8414fe11 authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman
Browse files

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: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca5af1f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
		}
	}