Skip to content

Commit

Permalink
fix: Add missing memunlock of local variable when it goes out of scope.
Browse files Browse the repository at this point in the history
Issue found by PVS Studio. It also found another one, but that's a false
positive.
  • Loading branch information
iphydf committed Feb 9, 2024
1 parent dab5fe4 commit b9877b3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions toxcore/group_chats.c
Original file line number Diff line number Diff line change
Expand Up @@ -4033,6 +4033,7 @@ static int handle_gc_key_exchange(const GC_Chat *chat, GC_Connection *gconn, con
// we're doing it anyway for symmetry with the memzero+munlock below, where we
// really do care about it.
crypto_memzero(new_session_sk, sizeof(new_session_sk));
crypto_memunlock(new_session_sk, sizeof(new_session_sk));

Check warning on line 4036 in toxcore/group_chats.c

View check run for this annotation

Codecov / codecov/patch

toxcore/group_chats.c#L4036

Added line #L4036 was not covered by tests
return -3;
}

Expand Down

0 comments on commit b9877b3

Please sign in to comment.