Commit add67b6f authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

server: Fix invalid memory access when copying KeyNameInformation data.

parent b94fe44e
......@@ -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 ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment