wmifs: Prevent crash when too many devices.
commit68555562b41d106ac19cb8ef54b77df7bdd13292
authorDoug Torrance <dtorrance@monmouthcollege.edu>
Wed, 22 Oct 2014 21:34:32 +0000 (22 16:34 -0500)
committerCarlos R. Mafra <crmafra@gmail.com>
Thu, 23 Oct 2014 07:03:31 +0000 (23 08:03 +0100)
treefc07e1571856f5eb72833df332c45d0da5b13779
parentc2155050c7a10370d673df81fbad12633ee147a9
wmifs: Prevent crash when too many devices.

Patch by Chris Hanson <cph@martigny.ai.mit.edu>.  First appeared in Debian
package 1.3b1-6.

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=39922:
wmifs crashes with a cryptic X error message when there are more than
4 net devices.  This occurs for me because I install vmware, which
installs 4 network devices for its bridging hack.

The bug is a loop that fills a fixed-length array, but doesn't stop
when the array is full.  The fix is to add a conditional break to the
loop.  A patch appears below.

I made two additional changes: (1) increased the size of the array,
and (2) changed a name comparison to compare all of the characters of
the name, rather than just the visible characters, since there may be
multiple net devices with the same first 4 characters (vmware does
this, too).
wmifs/wmifs/wmifs.c