Repository navigation
Conversation
Also make const strings static, where missing.
There was a problem hiding this comment.
Pull request overview
This PR improves maintainability in the SSH key-exchange (kex) implementation by removing hard-coded string lengths and avoiding runtime strlen() where the string is a compile-time constant.
Changes:
- Replace the magic constant
28for"[email protected]"withsizeof(...) - 1. - Replace
strlen()withsizeof(...) - 1for a constant KEX extension prefix string. - Make the affected constant strings
static constand adjust placement to match the PR’s stated cleanup goals.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vszakats
added a commit
that referenced
this pull request
Jul 25, 2026
This reverts an earlier change doing the opposite. `sizeof()` determines length at build-time, while `strlen()` does the same at runtime. In case of literals the results are identical, but the build-time option does it with zero runtime overhead. Also: - fix typo in literal used for determining length. (length was correct.) Follow-up to bc4e619 #752 - move literals to the right-side of comparisons, where missing. Follow-up to 88c5fd9 #2400 Follow-up to af1b501 #2224 Follow-up to 88a960a #1179 Closes #2432
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.
Also: