Skip to content
Snippets Groups Projects
Commit 7f1b48e3 authored by Fredrik Thulin's avatar Fredrik Thulin
Browse files

proto_read_attribute_array: When count is zero, make result a NULL ptr.

I am a bit uncertain about this change, since both NULL and non-NULL
will make test cases fail within the SoftHSM test suite for example
(some SoftHSM C_ functions want the pointer to be NULL when there
are no attributes, and some allow (expect) it to be possible to pass a
non-NULL pointer with a zero count).

It seems that making it a NULL pointer when the count is 0 is the most
sensible thing though. How could the C_ function use the data pointed
to by the pointer, when the count says there is no data there? The
result would really be undefined.
parent d4092d33
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment