Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty value state decryption panic #6321

Merged
merged 4 commits into from May 9, 2023
Merged

Fix empty value state decryption panic #6321

merged 4 commits into from May 9, 2023

Conversation

yaron2
Copy link
Member

@yaron2 yaron2 commented May 9, 2023

As reported on Discord, trying to decrypt an empty value results in the following panic:

panic: runtime error: slice bounds out of range [1:0]

goroutine 164 [running]:
github.com/dapr/dapr/pkg/encryption.TryDecryptValue({0xc000b8f320, 0xb}, {0x0, 0x0, 0x0})
        D:/a/dapr/dapr/pkg/encryption/state.go:64 +0x2f8
github.com/dapr/dapr/pkg/grpc.(api).GetState(0xc00149a000, {0x6578618, 0xc0013d1230}, 0xc0005fb860)
        D:/a/dapr/dapr/pkg/grpc/api.go:843 +0x4bf

Signed-off-by: yaron2 <schneider.yaron@live.com>
@yaron2 yaron2 requested review from a team as code owners May 9, 2023 02:28
@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Merging #6321 (fdfaf37) into master (546ca51) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #6321   +/-   ##
=======================================
  Coverage   64.47%   64.48%           
=======================================
  Files         189      189           
  Lines       18923    18925    +2     
=======================================
+ Hits        12200    12203    +3     
  Misses       5756     5756           
+ Partials      967      966    -1     
Impacted Files Coverage Δ
pkg/encryption/state.go 84.00% <100.00%> (+1.39%) ⬆️

... and 3 files with indirect coverage changes

@yaron2 yaron2 changed the title Fix empty value state encryption panic Fix empty value state decryption panic May 9, 2023
@yaron2 yaron2 merged commit efa5ad1 into dapr:master May 9, 2023
27 of 28 checks passed
@yaron2 yaron2 deleted the encfix-1 branch May 9, 2023 13:10
@mukundansundar mukundansundar added this to the v1.11 milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants