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

rpc: remove length assert in proto_read_attribute_buffer_array #631

Merged
merged 1 commit into from Mar 20, 2024

Conversation

ZoltanFridrich
Copy link
Contributor

@ZoltanFridrich ZoltanFridrich commented Mar 18, 2024

Return an error when parsed_array_size < actual_array_size rather then crashing with assert in proto_read_attribute_buffer_array.

@coveralls
Copy link

coveralls commented Mar 18, 2024

Coverage Status

coverage: 69.53% (-0.001%) from 69.531%
when pulling 88d13e8 on ZoltanFridrich:zfridric_devel
into f53bdc2 on p11-glue:master.

@ZoltanFridrich ZoltanFridrich self-assigned this Mar 18, 2024
Copy link
Member

@ueno ueno left a comment

Choose a reason for hiding this comment

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

Should we try to avoid integer overflow (wrap around this case) at multiplication? Maybe adding a check like ULONG_MAX / length < sizeof (CK_ATTRIBUTE) might help.

Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
@ZoltanFridrich
Copy link
Contributor Author

Should we try to avoid integer overflow (wrap around this case) at multiplication? Maybe adding a check like ULONG_MAX / length < sizeof (CK_ATTRIBUTE) might help.

I think you meant ULONG_MAX / n_array < sizeof (CK_ATTRIBUTE). Thats a good idea. Fixed.

@ZoltanFridrich ZoltanFridrich merged commit c7f12e2 into p11-glue:master Mar 20, 2024
14 checks passed
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

3 participants