changeset 35401:0c93b5400dc7

Check chdir() return value to avoid race condition. Checking the return value is a good idea anyway.
author ib
date Wed, 28 Nov 2012 12:14:46 +0000
parents 074069bb765a
children f9c4c37a7a43
files gui/ui/gtk/fileselect.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/fileselect.c	Wed Nov 28 11:57:52 2012 +0000
+++ b/gui/ui/gtk/fileselect.c	Wed Nov 28 12:14:46 2012 +0000
@@ -489,7 +489,7 @@
 
  if( ( stat( fsSelectedFile,&fs ) == 0 ) && S_ISDIR( fs.st_mode ) )
   {
-   chdir( fsSelectedFile );
+   if ( chdir( fsSelectedFile ) != 0 ) return;
    fsSelectedFile=fsThatDir;
    CheckDir( fsFNameList );
    gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() );