Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pppoe: Fix crash when a too-long device name is given (#447)
Fix for github issue #446. Signed-off-by: Eivind Næss <[email protected]>
- Loading branch information
91b203f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really not a problem to truncate the interface name like this? If two devices with long names are only different on the suffix, then there are still bugs here.
91b203f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I don't know whether or not that case could ever arise. The code being modified here is only used on Linux systems that don't have struct sockaddr_ll, which is not the usual case. Perhaps it reflects an old kernel with old headers. In that case it may not be possible for interfaces to have names that are long enough to trigger this problem.
We could add a check to make openInterface() fail if the interface name is too long.
91b203f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Reverier-Xu: Can you go and look all comments here: