server: Fix invalid memory access when copying KeyNameInformation data.
This commit is contained in:
parent
b94fe44e79
commit
add67b6f8d
|
@ -950,10 +950,10 @@ static void enum_key( const struct key *key, int index, int info_class,
|
|||
for (k = key; k != root_key; k = k->parent)
|
||||
{
|
||||
pos -= k->namelen;
|
||||
if (pos < len) memcpy( data + namelen, k->name,
|
||||
if (pos < len) memcpy( data + pos, k->name,
|
||||
min( k->namelen, len - pos ) );
|
||||
pos -= sizeof(backslash);
|
||||
if (pos < len) memcpy( data + namelen, backslash,
|
||||
if (pos < len) memcpy( data + pos, backslash,
|
||||
min( sizeof(backslash), len - pos ) );
|
||||
}
|
||||
memcpy( data, root_name, min( sizeof(root_name) - sizeof(backslash), len ) );
|
||||
|
|
Loading…
Reference in New Issue