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

Patch for 0.23.10 #62

Open
wants to merge 2 commits into
base: origin-0.23.10-1733196261
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions p11-kit/rpc-message.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ p11_rpc_buffer_get_byte_array (p11_buffer *buf,
return false;
}

if (buf->len < len || *offset > buf->len - len) {
if (buf->len < len || off > buf->len - len) {
p11_buffer_fail (buf);
return false;
}
Expand Down Expand Up @@ -1209,7 +1209,7 @@ p11_rpc_buffer_get_attribute (p11_buffer *buffer,
size_t *offset,
CK_ATTRIBUTE *attr)
{
uint32_t type, length;
uint32_t type, length, decode_length;
unsigned char validity;
p11_rpc_attribute_serializer *serializer;
p11_rpc_value_type value_type;
Expand Down Expand Up @@ -1239,8 +1239,13 @@ p11_rpc_buffer_get_attribute (p11_buffer *buffer,
assert (serializer != NULL);
if (!serializer->decode (buffer, offset, attr->pValue, &attr->ulValueLen))
return false;
if (!attr->pValue)
if (!attr->pValue) {
decode_length = attr->ulValueLen;
attr->ulValueLen = length;
if (decode_length > length) {
return false;
}
}
attr->type = type;
return true;
}
Expand Down
Loading