summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-28 21:52:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-28 21:52:53 +0000
commitca4c387054a36ac3429f102f2df4dd36292f3a48 (patch)
tree31c2590e79719a437cd10d5b9fcc3c05a7d460f7
parent2000-11-28 Sergei Organov <osv@javad.ru> (diff)
downloadrtems-ca4c387054a36ac3429f102f2df4dd36292f3a48.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.
-rw-r--r--c/src/lib/libc/memfile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/c/src/lib/libc/memfile.c b/c/src/lib/libc/memfile.c
index 9974a3d2d5..fe782f03c8 100644
--- a/c/src/lib/libc/memfile.c
+++ b/c/src/lib/libc/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);