summaryrefslogtreecommitdiffstats
path: root/python-ethtool/etherinfo_struct.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2013-01-15 14:59:47 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2013-01-15 14:59:47 -0500
commita95070733f068f9fa1f9e06ec98426164bedecc4 (patch)
tree456d4c3b6dfa2a2bb4a68185e9b59dea6a4d2b63 /python-ethtool/etherinfo_struct.h
parentd134c6c5c5f740407fa8244b6a0b94fc50924986 (diff)
downloadpython-ethtool-a95070733f068f9fa1f9e06ec98426164bedecc4.tar.gz
python-ethtool-a95070733f068f9fa1f9e06ec98426164bedecc4.tar.xz
python-ethtool-a95070733f068f9fa1f9e06ec98426164bedecc4.zip
Fix bad loop condition within get_devices()
get_devices() includes this loop: char buffer[256]; ...snip... char *end = buffer; ...snip... while (end && *end != ':') end++; The condition "end" within the while guard will always be true, given that buffer is on the stack and thus will never be near the zero value. It should be *end instead, to check for the NUL terminator byte: this code will likely crash if the string does not contain a colon character. 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.
Diffstat (limited to 'python-ethtool/etherinfo_struct.h')
0 files changed, 0 insertions, 0 deletions