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
@ZoltanFridrich ZoltanFridrich requested a review from ueno March 18, 2024 15:44
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.

@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
@ZoltanFridrich ZoltanFridrich added this to the 0.25.4 milestone Jul 1, 2024
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.

3 participants