Draft
Conversation
* refactor!: enable hidden admin protocol * feat: admin protocol * fix admin test to skip in appveyor * fix protocol parsing logic in URL() * use SplitN * handle ipv6 in URL() * Update docs for v1.0 tag BREAKING CHANGE: Add `Hidden()` method to `ProtocolParser` interface
* go mod vendor npipe to this repo * switch to internal package
* fix: mips and mipsel builds fixes: denisenkom#123 * swap el or le
* Allow for local dns resolution with a custom dialer * Use a new dialer type * fix unit test * Add changelog & readme
…er (denisenkom#126) * Added MarshalText() and UnmarshalJSON interfaces - The existing MarshalText() for the UniqueIdentifier type had a bad signature. It omitted returning an error that the interface expects. - Added UnmarshalJSON() interface to the UniqueIdentifier type with a test as well * use strings.Replace instead of ReplaceAll
fix: protocol version
Remove message referring to MSFT fork since we are there.
Update README.md
* Fix: Handle extended chars in SQL instance names
* add core CEK parameters and types * add column encryption featureext * Add parsing of always encrypted tokens * implement local cert key provider * use key providers for decrypt * implement EncryptColumnEncryptionKey for local cert * add cipher data to parameters * copy swisscom code locally * implement Encrypt * don't claim to support enclaves * update readme * fix Scan to use correct data types * make cert store provider go1.17+ * rename files for clarity * update dependencies and min Go version * update reviewdog * remove old SQL versions from PR build
Update title to stand out in search results.
Update README.md Title
* Feat: Implement change password during login * use -v for go test * move assert usage to go117+
Change parameters to match driver rather than sdk
This commit fixes denisenkom#136. Adds support for TDS8. TDS8 connection can now be used by specifying encrypt=strict. TrustServerCertificate=true will not come into effect when encrypt is set to 'strict'.
Add note on CLI authentication
Co-authored-by: akondratev <artem.kondratev@goods.ru>
…nisenkom#155) * Add context parameter to key provider interface * update error handling for AE key providers
* FEAT:support environment config of krb5 * update readme and version * use client keytab file as default
…enisenkom#158 (denisenkom#159) * fix: Added multisubnetfailover option that can be set to false to prevent issue denisenkom#158
* Fix mappings between LCIDs and code pages. * Add test for fetching various LCIDs. * Address Github automation feedback. * Refine comments. --------- Co-authored-by: Sergey Ten <sergeyten@microsoft.com>
* Reserve extra space for out parameter + tests. * Test for []byte parameter. --------- Co-authored-by: El-76 <anton.ostroumov@gmail.com>
* lazy initialization of charset maps * initialize each charsetmap separately * switch from init to get
* Update dependencies * support dataverse endpoint
* Refactor UniqueIdentifier tests * Parallelize tests * Add NullableUniqueIdentifier type * Add missing test case for UniqueIdentifier * Improve error message * Rename to NullUniqueIdentifier * Add NullUniqueIdentifier to TestBulkcopy * Add uniqueidentifier parsing to the list of Features * Add Valid bool to NullUniqueIdentifier * Handle null in UnmarshalJSON() * Handle !Valid in Value(),String(),MarshalText() --------- Co-authored-by: Norman Gehrsitz <git@gehrsitz.eu>
* preserve type information for Valuer parameters * support uniqueidentifier in AE * update readme
* Fix:Enable connection to WID
* fix: support nullable types for bulkcopy * Add test cases for all nullable types * Fix test cases * Add bulkcopy test for invalid nullable types * Add case in convertInputParameter to bypass uniqueidentifier type * Add test cases for invalid nullable test * Revert bypass change
* handle sql.NullTime parameters * Match SQL sizes for sql.Nullxxx integer types * handle custom nullable Valuer implementations
* Vulnerabilty depency x/net * Att Dependencies
* Accept hierarchyid as a valid type * error * derp * geography and geometry * Return value * Tests * Typo * Upper * hasSize
…rado/update-library-microsoft
| if err != nil { | ||
| panic(err) | ||
| } | ||
| bytes[i] = byte(b) |
Check failure
Code scanning / CodeQL
Incorrect conversion between integer types
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we need to ensure that the value parsed by strconv.ParseInt is within the range of a byte (0 to 255) before converting it. This can be done by adding a check to ensure the parsed value is within the valid range for a byte. If the value is out of range, we should handle the error appropriately.
- Parse the string using
strconv.ParseIntwith a bit size of 8 to directly get an 8-bit integer. - Check if the parsed value is within the range of a
byte(0 to 255). - If the value is within the range, convert it to a
byte. - If the value is out of range, handle the error (e.g., by panicking or returning a default value).
Suggested changeset
1
aecmk/localcert/keyprovider.go
| @@ -256,3 +256,3 @@ | ||
| for i := range bytes { | ||
| b, err := strconv.ParseInt(thumbprint[i*2:(i*2)+2], 16, 32) | ||
| b, err := strconv.ParseInt(thumbprint[i*2:(i*2)+2], 16, 8) | ||
| if err != nil { | ||
| @@ -260,2 +260,5 @@ | ||
| } | ||
| if b < 0 || b > 255 { | ||
| panic(fmt.Errorf("Parsed value out of byte range: %d", b)) | ||
| } | ||
| bytes[i] = byte(b) |
Copilot is powered by AI and may make mistakes. Always verify output.
5 tasks
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.
Fetched from the Microsoft repo on 10/04 (last commit being ported) and merged to our main branch.