On Tue, 2013-01-15 at 14:49 -0500, David Malcolm wrote:
get_module() includes this scanf call:
if (sscanf(buf, "%*d\t%*s\t%100s\t%*d\t%100s\n", driver, dev) > 0) {
i.e. "%100s" for each of driver and dev. i.e. a maximum field width of
100 for each.
However, this field width does not include the NUL terminator.
Increase the size of driver and dev from 100 to 101 to allow for the NUL byte.
This appears to have been present in the initial commit of the code
(8d6ad996f5d60d569532cdba4febb19c69bdf488)
Found by Braňo Náter using the "cppcheck" static analyzer.
Pushed to
git://git.fedorahosted.org/python-ethtool.git as
d134c6c5c5f740407fa8244b6a0b94fc50924986