Changeset 6d9ab345 in rtems


Ignore:
Timestamp:
Mar 18, 2013, 2:19:35 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
df6818f9
Parents:
c2015b44
git-author:
Sebastian Huber <sebastian.huber@…> (03/18/13 14:19:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/18/13 15:26:31)
Message:

IMFS: Fix NULL pointer access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/imfs/memfile.c

    rc2015b44 r6d9ab345  
    4040);
    4141
    42 MEMFILE_STATIC int IMFS_memfile_remove_block(
     42MEMFILE_STATIC void IMFS_memfile_remove_block(
    4343   IMFS_jnode_t  *the_jnode,
    4444   unsigned int   block
     
    274274   */
    275275  block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 );
     276  if ( !block_entry_ptr )
     277    return 1;
     278
    276279  if ( *block_entry_ptr )
    277280    return 0;
     
    298301 *         dangerous and the results unpredictable.
    299302 */
    300 MEMFILE_STATIC int IMFS_memfile_remove_block(
     303MEMFILE_STATIC void IMFS_memfile_remove_block(
    301304   IMFS_jnode_t  *the_jnode,
    302305   unsigned int   block
     
    307310
    308311  block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
    309   IMFS_assert( block_ptr );
    310 
    311   ptr = *block_ptr;
    312   *block_ptr = 0;
    313   memfile_free_block( ptr );
    314 
    315   return 1;
     312  if ( block_ptr ) {
     313    ptr = *block_ptr;
     314    *block_ptr = 0;
     315    memfile_free_block( ptr );
     316  }
    316317}
    317318
Note: See TracChangeset for help on using the changeset viewer.