-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Nethelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
A system may be without a WINS option at line 134 we should check if the index return is -1.
Lines 133 to 134 in 77fb038
| int labelIndex = fileContents.IndexOf(label); | |
| int labelLineStart = fileContents.LastIndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal); |
Exemple of exception:
{System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)}
Where the labelIndex was -1 in ParseWinsServerAddressesFromSmbConfFile.
Metadata
Metadata
Assignees
Labels
area-System.Nethelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged