Conversation
Owner
Author
|
@codex rebase |
Summary
Testing
|
Owner
Author
|
@codex rebase onto main |
Summary
Testing
|
jet2jet
commented
Feb 23, 2026
ShellDLL/Auth.cpp
Outdated
| { | ||
| DWORD dwKeyTypeLen = ConvertEndian(*((DWORD*)(pBlob))); | ||
| LPCSTR lpszKeyType = (LPCSTR)(pBlob + 4); | ||
| DWORD dwKeyTypeLen = ConvertEndian(*reinterpret_cast<DWORD*>(pBlob)); |
Owner
Author
There was a problem hiding this comment.
@codex please fix the cast type by adding const (since pBlob is LPCBYTE, which is constant)
There was a problem hiding this comment.
Summary
- Updated the cast at the reviewer-requested location to preserve const-correctness by changing
reinterpret_cast<DWORD*>(pBlob)toreinterpret_cast<const DWORD*>(pBlob)when readingdwKeyTypeLenfrompBlob(LPCBYTE). ShellDLL/Auth.cppL455 - Committed the change on branch
workas07f0e4fwith message:fix: preserve constness when reading key type length. ShellDLL/Auth.cppL455
Testing
⚠️ python - <<'PY' import requests, urllib.parse q='LPCBYTE const reinterpret_cast C++' url='https://duckduckgo.com/html/?q='+urllib.parse.quote(q) print('fetch',url) r=requests.get(url,timeout=10) print(r.status_code, len(r.text)) print(r.text[:200]) PY(warning: environment limitation,requestsmodule not installed)- ✅
python - <<'PY' import urllib.parse, subprocess q='LPCBYTE const reinterpret_cast C++' url='https://duckduckgo.com/html/?q='+urllib.parse.quote(q) print(url) subprocess.run(['curl','-L','-s',url],check=False) PY - ✅
git diff -- ShellDLL/Auth.cpp && git status --short - ✅
git add ShellDLL/Auth.cpp && git commit -m "fix: preserve constness when reading key type length"
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.
Motivation
Description
ShellDLL/Auth.cppwithreinterpret_castandstatic_castwhere appropriate around SSH agent key/blob parsing and signature handling.size_twithstatic_cast<size_t>when computing SSH blob lengths.(LPCWSTR) IDS_APP_TITLEoccurrences withMAKEINTRESOURCEW(IDS_APP_TITLE)inEasySFTP/Func.cppandShellDLL/Func.cppto avoid casting resource IDs to pointer types.ShellDLL/Auth.cpp,EasySFTP/Func.cpp, andShellDLL/Func.cppto keep casting explicit and more C++-idiomatic.Testing
git diff --check, which reported trailing-whitespace warnings on the modified CRLF lines (warning/failure due to repository line-ending differences).git status --shortto verify only intended files were modified, which succeeded and showed a clean working tree after staging changes.Codex Task