Skip to content

[bugfix] (*KeyCredential).Unmarshal should return errors but never panic, fixe…#35

Merged
p0dalirius merged 1 commit intomainfrom
KeyCredential-Unmarshal-should-return-errors-but-never-panic
Oct 31, 2025
Merged

[bugfix] (*KeyCredential).Unmarshal should return errors but never panic, fixe…#35
p0dalirius merged 1 commit intomainfrom
KeyCredential-Unmarshal-should-return-errors-but-never-panic

Conversation

@p0dalirius
Copy link
Copy Markdown
Contributor

…s #34

@p0dalirius p0dalirius requested a review from Copilot October 31, 2025 09:53
@p0dalirius p0dalirius self-assigned this Oct 31, 2025
@p0dalirius p0dalirius added the bug Something isn't working label Oct 31, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the KeyCredential.Unmarshal method to improve error handling, bounds checking, and code clarity. It also adds a basic test case for the unmarshal functionality.

  • Adds comprehensive bounds checking to prevent slice out-of-bounds panics
  • Improves error messages with contextual information using error wrapping
  • Fixes the entry type parsing to correctly read from the appropriate offset

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
windows/keycredential/KeyCredential.go Refactored Unmarshal method with improved bounds checking, error handling, and documentation
windows/keycredential/KeyCredential_test.go Added test case for Unmarshal method to validate error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@p0dalirius p0dalirius merged commit 30156ca into main Oct 31, 2025
11 checks passed
@p0dalirius p0dalirius deleted the KeyCredential-Unmarshal-should-return-errors-but-never-panic branch October 31, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants