Skip to content

Fix null check in save_out_buf and save_out_buf_wide functions #251

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

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

TheBestTvarynka
Copy link
Collaborator

@TheBestTvarynka TheBestTvarynka commented Jun 10, 2024

Hi,
After the last intermediate PR I did some dev testing to check if everything is sill working. I found a small mistake and fixed it in this PR.
Also, I've improved the logging a little bit.

Previously, these function always check that the data pointer is not
`null`. But actually we need to check it only in the `OutBuffer::Allocated`
case. Move this check into the corresponding `match` branch and updated
the safety comment.
@TheBestTvarynka TheBestTvarynka self-assigned this Jun 10, 2024
@TheBestTvarynka TheBestTvarynka marked this pull request as ready for review June 10, 2024 12:01
@TheBestTvarynka TheBestTvarynka requested a review from CBenoit June 10, 2024 12:01
Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

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

LGTM! Good catch.

@TheBestTvarynka TheBestTvarynka merged commit 10f8825 into system-scards-support Jun 10, 2024
@TheBestTvarynka TheBestTvarynka deleted the fix/out-buffer-writing branch June 10, 2024 14:44
TheBestTvarynka added a commit that referenced this pull request Jun 10, 2024
)

* fix(ffi): winscard: `save_out_buf_wide` and `save_out_buf` functions.

Previously, these function always check that the data pointer is not
`null`. But actually we need to check it only in the `OutBuffer::Allocated`
case. Move this check into the corresponding `match` branch and updated
the safety comment.

* feat(ffi): winscard: improve logging for the `WinScardContextHandle` and `WinScardHandle`;
TheBestTvarynka added a commit that referenced this pull request Jun 10, 2024
…f_wide` functions (#251)

Previously, these function always check that the data pointer is not
`null`. But actually we need to check it only in the `OutBuffer::Allocated`
case. Move this check into the corresponding `match` branch and updated
the safety comment.

Improve logging for the `WinScardContextHandle` and `WinScardHandle`.
CBenoit pushed a commit that referenced this pull request Jun 11, 2024
…f_wide` functions (#251)

Previously, these function always check that the data pointer is not
`null`. But actually we need to check it only in the `OutBuffer::Allocated`
case. Move this check into the corresponding `match` branch and updated
the safety comment.

Improve logging for the `WinScardContextHandle` and `WinScardHandle`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants