Skip to content

Unlock mutex before returning error#2281

Merged
xuri merged 1 commit intoqax-os:masterfrom
Journeyman150:fix/mutex-unlock-on-error
Mar 25, 2026
Merged

Unlock mutex before returning error#2281
xuri merged 1 commit intoqax-os:masterfrom
Journeyman150:fix/mutex-unlock-on-error

Conversation

@Journeyman150
Copy link
Copy Markdown
Contributor

PR Details

Fixed 2 potential vulnerabilities (deadlock) related to f.mu.Unlock() not being called before returning an error.

Description

Added calls to f.mu.Unlock() before returning an error.
Affected methods:

  • styles.go:1661: GetStyle(idx int)
  • styles.go:1766: GetConditionalStyle(idx int)

Related Issue

Motivation and Context

How Has This Been Tested

Tested by running all existing tests

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 24, 2026
@xuri xuri moved this to BugFix in Excelize v2.11.0 Mar 24, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.60%. Comparing base (48a958f) to head (f3d39c8).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2281   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files          32       32           
  Lines       26697    26699    +2     
=======================================
+ Hits        26591    26593    +2     
  Misses         55       55           
  Partials       51       51           
Flag Coverage Δ
unittests 99.60% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks for your contribution.

@xuri xuri merged commit 0aec9b7 into qax-os:master Mar 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

Status: BugFix

Development

Successfully merging this pull request may close these issues.

2 participants