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

libffi: Fix handling of pulCount parameter of C_GetInterfaceList #505

Merged
merged 1 commit into from
May 9, 2023

Conversation

ueno
Copy link
Member

@ueno ueno commented May 7, 2023

When C_GetInterfaceList is called with NULL pInterfaceList, It doesn't make any sense to check the content of pulCount.

Fixes: #495

@coveralls
Copy link

coveralls commented May 7, 2023

Coverage Status

Coverage: 70.279% (-0.02%) from 70.295% when pulling 990bd5a on ueno:wip/dueno/libffi-fixes into e5a62d8 on p11-glue:master.

@ueno ueno requested a review from ZoltanFridrich May 7, 2023 06:32
Copy link
Contributor

@ZoltanFridrich ZoltanFridrich left a comment

Choose a reason for hiding this comment

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

From the specification:

If pInterfaceList is NULL_PTR, then all that C_GetInterfaceList does is return (in *pulCount) the number of interfaces, without actually returning a list of interfaces. The contents of *pulCount on entry to C_GetInterfaceList has no meaning in this case, and the call returns the value CKR_OK.

Makes sense. Changes look good.

When C_GetInterfaceList is called with NULL pInterfaceList, It doesn't
make any sense to check the content of pulCount.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
@ueno ueno force-pushed the wip/dueno/libffi-fixes branch from a4b60b3 to 990bd5a Compare May 9, 2023 12:50
@ueno ueno merged commit 6f6c04d into p11-glue:master May 9, 2023
@ueno
Copy link
Member Author

ueno commented May 9, 2023

Thanks!

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.

p11-kit 0.24.1 fails assertions
3 participants