FIX: S360 Resolve [CodeQL.SM02986] 'Cast from char* to wchar_t*#309
Merged
bewithgaurav merged 6 commits intomainfrom Nov 7, 2025
Merged
FIX: S360 Resolve [CodeQL.SM02986] 'Cast from char* to wchar_t*#309bewithgaurav merged 6 commits intomainfrom
bewithgaurav merged 6 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds suppression comments for CodeQL static analysis warnings (SM02986) related to reinterpret_cast operations when converting raw byte buffers to wide character types (SQLWCHAR* and wchar_t*) in the LOB data fetching function.
Key changes:
- Added inline comments justifying the safety of three
reinterpret_castoperations - Comments explain alignment guarantees from
std::vectorand ODBC driver behavior
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changes
Summary
📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)🔗 Quick Links
|
bewithgaurav
approved these changes
Nov 4, 2025
Collaborator
bewithgaurav
left a comment
There was a problem hiding this comment.
minor comment addition request
sumitmsft
approved these changes
Nov 5, 2025
bewithgaurav
approved these changes
Nov 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work Item / Issue Reference
Summary
This pull request adds explanatory comments to several
reinterpret_caststatements in theFetchLobColumnDatafunction withinmssql_python/pybind/ddbc_bindings.cpp, clarifying the safety of these casts for CodeQL static analysis. The comments explain why casting fromstd::vectordata to wide character pointers is safe in this context.Code safety and documentation improvements:
reinterpret_cast<const SQLWCHAR*>(chunk.data())and similar casts, explaining alignment guarantees and safe usage for CodeQL [SM02986] in both Windows and Linux/macOS code paths. [1] [2]