summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libfs/src/imfs/memfile.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-03-23 14:02:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-03-23 14:02:02 +0000
commitd79ef179dc5f73821e96e3cbf063e90a21901ecb (patch)
tree0b6e4c1d11dbac2a9bc5289ad2221dcbeab1e904 /c/src/exec/libfs/src/imfs/memfile.c
parentchanged version to ss-20010319 (diff)
downloadrtems-d79ef179dc5f73821e96e3cbf063e90a21901ecb.tar.bz2
2001-03-23 Joel Sherrill <joel@OARcorp.com>
* src/imfs/memfile.c: Reapply fix from bug report from Jose Sturniolo <jsturnio@nec.com.ar> where NULL pointer was dereferenced when freeing a triply indirect file. The fix was applied to the 4.5 release branch and not the development branch.
Diffstat (limited to '')
-rw-r--r--c/src/exec/libfs/src/imfs/memfile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/c/src/exec/libfs/src/imfs/memfile.c b/c/src/exec/libfs/src/imfs/memfile.c
index 8ae7e5e6ba..fc2680fcfe 100644
--- a/c/src/exec/libfs/src/imfs/memfile.c
+++ b/c/src/exec/libfs/src/imfs/memfile.c
@@ -509,6 +509,8 @@ int IMFS_memfile_remove(
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
p = (block_p *) info->triply_indirect[i];
+ if ( !p ) /* ensure 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);