summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libfs/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-28 21:53:48 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-28 21:53:48 +0000
commit6b5519a4f337570e42f2d78cbf20aba91e71bcbf (patch)
treebe78d5f8372491afa16cc31698f84d453d78d842 /c/src/exec/libfs/src
parent2000-11-28 Sergei Organov <osv@javad.ru> (diff)
downloadrtems-6b5519a4f337570e42f2d78cbf20aba91e71bcbf.tar.bz2
2000-11-28 Joel Sherrill <joel@OARcorp.com>
* src/imfs/memfile.c: Bug report from Sturniolo Jose <jsturnio@nec.com.ar> where NULL pointer was dereferenced.
Diffstat (limited to 'c/src/exec/libfs/src')
-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 64dab775f0..890f2aebc1 100644
--- a/c/src/exec/libfs/src/imfs/memfile.c
+++ b/c/src/exec/libfs/src/imfs/memfile.c
@@ -499,6 +499,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);