I reported this privately last week, and that call was promptly removed in SVN

--------------------------------------------
On Sat, 31/3/18, Eric Wing <ewmail...@gmail.com> wrote:

 Subject: [Iup-users] Regression bug in iup_config.c? (Crash if there is no 
config file)
 To: "IUP discussion list." <iup-users@lists.sourceforge.net>
 Date: Saturday, 31 March, 2018, 0:04
 
 I just discovered a crash I didn't have
 before using IupConfigLoad()
 after recently resyncing to to SVN.
 
 If the config file is missing, my
 program crashes. Tracking it down,
 it appears to be caused by a change
 that introduced a call to:
    
 iupLineFileClose(line_file);
 
 as follows:
 
 
 int IupConfigLoad(Ihandle* ih)
 {
   char group[GROUPKEYSIZE] = "";
   char key[GROUPKEYSIZE];
   IlineFile* line_file;
 
   char* filename =
 iConfigSetFilename(ih);
   if (!filename)
     return -3;
 
   line_file =
 iupLineFileOpen(filename);
   if (!line_file)
   {
    
 iupLineFileClose(line_file);
     return -1;
   }
 
 <snip>
 
 
 If the config file is missing,
 line_file == NULL.
 Then iupLineFileClose(line_file); is
 called.
 
 
 That is defined as:
 
 void iupLineFileClose(IlineFile*
 line_file)
 {
   fclose(line_file->file);
  
 free(line_file->line_buffer);  /* use free because
 of realloc */
   free(line_file);
 }
 
 
 Which means, it is dereferencing a NULL
 pointer when doing line_file->file.
 
 
 As far as I can tell, the config file
 will still only be created
 calling IupConfigSave(), so there is no
 expectation that this file is
 guaranteed to exist.
 
 Can you confirm?
 
 Thanks,
 Eric
 
 ------------------------------------------------------------------------------
 Check out the vibrant tech community on
 one of the world's most
 engaging tech sites, Slashdot.org! http://sdm.link/slashdot
 _______________________________________________
 Iup-users mailing list
 Iup-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/iup-users
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to