bugfix #2931 crash if $HOME not set
unchecked pointer returned from BLI_gethome().
This commit is contained in:
@@ -69,8 +69,15 @@ char *bpy_gethome(int append_scriptsdir)
|
||||
else if (homedir[0] != '\0')
|
||||
return homedir;
|
||||
|
||||
/* BLI_gethome() can return NULL if env vars are not set */
|
||||
s = BLI_gethome();
|
||||
|
||||
if( !s ) /* bail if no $HOME */
|
||||
{
|
||||
printf("$HOME is NOT set\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if( strstr( s, ".blender" ) )
|
||||
PyOS_snprintf( homedir, FILE_MAXDIR, s );
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user