Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private void deleteExitingLinkLocalRouteTable(String linkLocalBr) {
for (String line : lines) {
String[] tokens = line.split(" ");
if (!tokens[2].equalsIgnoreCase(linkLocalBr)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am concerned about the unchecked array access in the event of malformed/unexpected input. Consider the following as a bit of extra safety in the event of malformed input beginning at line 289:

if (tokens != null && tokens.length < 2) {
   // Should we emit a log warning here to indicate that we received an unexpected string format?
   continue;
}

final String device = tokens[2];
if (!Strings.isNullOrEmpty(device) &&
    !device.equalsIgnoreCase(linkLocalBr)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR we cannot make any changes now that it is merged already; perhaps send a new PR or I can pick it up later.

Script.runSimpleBashScript("ip route del " + NetUtils.getLinkLocalCIDR());
Script.runSimpleBashScript("ip route del " + NetUtils.getLinkLocalCIDR() + " dev " + tokens[2]);
} else {
foundLinkLocalBr = true;
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.