Commit 5493b772 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

kernel32: Handle username conversion failure (Coverity).

parent 2c7ac136
......@@ -495,6 +495,7 @@ static void set_additional_environment(void)
MultiByteToWideChar( CP_UNIXCP, 0, name, -1, user_name, len );
SetEnvironmentVariableW( usernameW, user_name );
}
else WARN( "user name %s not convertible.\n", debugstr_a(name) );
/* set the USERPROFILE and ALLUSERSPROFILE variables */
......@@ -522,8 +523,10 @@ static void set_additional_environment(void)
strcpyW( value, profile_dir );
p = value + strlenW(value);
if (p > value && p[-1] != '\\') *p++ = '\\';
strcpyW( p, user_name );
SetEnvironmentVariableW( userprofileW, value );
if (user_name) {
strcpyW( p, user_name );
SetEnvironmentVariableW( userprofileW, value );
}
if (all_users_dir)
{
strcpyW( p, all_users_dir );
......
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