Skip to content

Add null checks for interactPtr and defaultsPtr parameters in SaslInteractionProcedure - #131456

Open
Mutatius wants to merge 1 commit into
dotnet:mainfrom
Mutatius:fix/ldap-sasl-null-safe
Open

Add null checks for interactPtr and defaultsPtr parameters in SaslInteractionProcedure#131456
Mutatius wants to merge 1 commit into
dotnet:mainfrom
Mutatius:fix/ldap-sasl-null-safe

Conversation

@Mutatius

Copy link
Copy Markdown

PtrToStructure may return null if currentInteractPtr equals IntPtr.Zero, resulting in dereferencing null in interactChallenge.saslChallengeType. The SaslInteractionProcedure is a callback invoked by native LDAP library, so pointer parameters may be IntPtr.Zero in error scenarios. Add null checks for interactPtr, currentInteractPtr, and interactChallenge before member access to prevent NullReferenceException.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 28, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-directoryservices
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.DirectoryServices community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant