You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value (List<string>)value, which can have null value due to comparison with null, is dereferenced inside function _servicePrincipalNames.Load().
#94753
Open
achufistov opened this issue
Nov 15, 2023
· 2 comments
Problem: Value (List)value, which can have null value due to comparison with null, is dereferenced inside function _servicePrincipalNames.Load().
Reproduction Steps
Trace:
Role: detected
detected
[Computer.cs:[120:0]]
Role: compared with null
Comparison value == null of value (List)value with null implies that (List)value can have null value
[Computer.cs:[115:128]]
Role: dereference
3.1 Value (List)value is dereferenced inside invocation _servicePrincipalNames.Load((List)value)
[Computer.cs:[120:21]]
3.2 Value values is dereferenced at values.Count
[ValueCollection.cs:[377:102]]
Problem: Value (List)value, which can have null value due to comparison with null, is dereferenced inside function _servicePrincipalNames.Load().
Reproduction Steps
Trace:
Role: detected
detected
[Computer.cs:[120:0]]
Role: compared with null
Comparison value == null of value (List)value with null implies that (List)value can have null value
[Computer.cs:[115:128]]
Role: dereference
3.1 Value (List)value is dereferenced inside invocation _servicePrincipalNames.Load((List)value)
[Computer.cs:[120:21]]
3.2 Value values is dereferenced at values.Count
[ValueCollection.cs:[377:102]]
This method has several overrides and the virtual method on parent type looks safe null value. There is 2 cases where it is called with null explicitly:
In general, to determine if the method has nullability issue or not should be determined during nullability annotation for the project, which is tracked by #41720. I think we should close this issue as dup of #41720, what you think @achufistov?
Description
Dotnet 6.0
File: /src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Computer.cs:120
Problem: Value (List)value, which can have null value due to comparison with null, is dereferenced inside function _servicePrincipalNames.Load().
Reproduction Steps
Trace:
Role: detected
detected
[Computer.cs:[120:0]]
Role: compared with null
Comparison value == null of value (List)value with null implies that (List)value can have null value
[Computer.cs:[115:128]]
Role: dereference
3.1 Value (List)value is dereferenced inside invocation _servicePrincipalNames.Load((List)value)
[Computer.cs:[120:21]]
3.2 Value values is dereferenced at values.Count
[ValueCollection.cs:[377:102]]
Role: execution path
4.1 Step 1: Condition value == null taking true branch
[Computer.cs:[115:128]]
4.2 Step 2: Condition propertyName == PropertyNames.ComputerServicePrincipalNames taking true branch
[Computer.cs:[119:23]]
Expected behavior
null pointer dereference
Actual behavior
same
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
Found by Linux Verification Center (linuxtesting.org) with SVACE.
The text was updated successfully, but these errors were encountered: