server: Fix invalid memory access when copying KeyNameInformation data.

This commit is contained in:
Sebastian Lackner 2014-10-17 06:08:20 +02:00 committed by Alexandre Julliard
parent b94fe44e79
commit add67b6f8d
1 changed files with 2 additions and 2 deletions

View File

@ -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 ) );