Potential buffer overflow in PROFILE_CopyEntry.

This commit is contained in:
Francois Gouget 2001-05-07 18:11:57 +00:00 committed by Alexandre Julliard
parent c6a835a63e
commit 09a17830ac
1 changed files with 4 additions and 2 deletions

View File

@ -120,9 +120,11 @@ static void PROFILE_CopyEntry( char *buffer, const char *value, int len,
lstrcpynA(env_val, p + 2, min( sizeof(env_val), (int)(p2-p)-1 ));
if ((env_p = getenv( env_val )) != NULL)
{
int buffer_len;
lstrcpynA( buffer, env_p, len );
buffer += strlen( buffer );
len -= strlen( buffer );
buffer_len = strlen( buffer );
buffer += buffer_len;
len -= buffer_len;
}
p = p2 + 1;
}