-
Notifications
You must be signed in to change notification settings - Fork 5k
fix(transport): fix SASL null pointer check and build config #35221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -97,6 +97,8 @@ void saslBufferClear(SSaslBuffer* buf) { | |||||
| saslBufferClearImpl(buf); | ||||||
| } | ||||||
|
|
||||||
| #if !defined(TD_ENTERPRISE) | ||||||
|
||||||
| #if !defined(TD_ENTERPRISE) | |
| #if !(defined(TD_ENTERPRISE) && defined(LINUX)) |
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.
The NULL pointer check for pConn is added within the stub implementation of saslConnShoudDoAuthImpl, which is wrapped in a #if !defined(TD_ENTERPRISE) block. However, the changes in CMakeLists.txt indicate that this build is intended to support Enterprise features where TD_ENTERPRISE is defined. In Enterprise builds, this stub is skipped, and the check will not be present. To effectively prevent potential crashes (e.g., in transSvr.c at line 1752), this NULL check should be moved to the wrapper function saslAuthIsInited at line 74, which is used by both Enterprise and non-Enterprise configurations.
Copilot
AI
Apr 23, 2026
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.
The new NULL handling was added inside the non-enterprise stub implementation. When TD_ENTERPRISE is defined, saslAuthIsInited(NULL) will still dispatch to the enterprise saslConnShoudDoAuthImpl implementation via the wrapper without any NULL guard. Since several call sites pass conn->saslConn without checking for NULL, the NULL check should be enforced in a common location (e.g., in saslAuthIsInited) or guaranteed in the enterprise impl as well; otherwise the reported null-pointer issue may persist for enterprise builds.
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.
transSaslImpl.c is now always added when TD_ENTERPRISE is enabled, but libsasl2 is only pulled in on Linux later in this CMake file. If enterprise builds are supported on non-Linux platforms (the top-level options.cmake suggests enterprise Windows builds exist), this unconditional source inclusion can break compilation/linking. Consider appending transSaslImpl.c only when TD_ENTERPRISE && TD_LINUX (or otherwise ensure transSaslImpl.c is fully guarded for non-Linux builds).