cid#706201: No need to call access prior to realpath here
...and thus silence a TOCTOU warning Change-Id: I17f36181946616747d84aca6d43e44d180dc8741
This commit is contained in:
@@ -156,12 +156,8 @@ static char* platformSpecific(void)
|
|||||||
strcpy( file, dir );
|
strcpy( file, dir );
|
||||||
strcat( file, APPENDIX );
|
strcat( file, APPENDIX );
|
||||||
|
|
||||||
/* check existence of soffice file */
|
|
||||||
if ( !access( file, F_OK ) )
|
|
||||||
{
|
|
||||||
/* resolve symbolic link */
|
/* resolve symbolic link */
|
||||||
resolved = realpath( file, buffer );
|
resolved = realpath( file, buffer );
|
||||||
|
|
||||||
if ( resolved != NULL )
|
if ( resolved != NULL )
|
||||||
{
|
{
|
||||||
/* get path to program directory */
|
/* get path to program directory */
|
||||||
@@ -177,7 +173,6 @@ static char* platformSpecific(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
dir = strtok( NULL, PATHSEPARATOR );
|
dir = strtok( NULL, PATHSEPARATOR );
|
||||||
free( file );
|
free( file );
|
||||||
|
Reference in New Issue
Block a user