IMFS bug fix

Sturniolo Jose jsturnio at nec.com.ar
Wed Nov 22 15:23:17 UTC 2000



I'm including a bug fix to the IMFS.
How to replicate the bug:  
	Perform a put using FTP with a 1 Mbytes file. 
	Delete (from FTP client) the same file.

The file modified is memfile.c (libc), in function IMFS_memfile_remove()
I added 2 lines checking the pointer. (see comment below)
I tested using the MALLOC test routines in order to check if the memory is
freeded and looks good. 

Line 494:
  if ( info->triply_indirect ) {
    for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
      p = (block_p *) info->triply_indirect[i];
	if (!p)				/* Check if we have a valid pointer
*/
		break;	
      for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
        if ( p[j] ) {
          memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
        }
      }
      memfile_free_blocks_in_table(
        (block_p **)&info->triply_indirect[i], to_free );
    }
    memfile_free_blocks_in_table(
        (block_p **)&info->triply_indirect, to_free );
  }




Jose Sturniolo
Product Engineering & Development Department
Development & Implementations Division
NEC Argentina S.A.




More information about the users mailing list