summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/exec/libfs/ChangeLog5
-rw-r--r--c/src/exec/libfs/src/imfs/memfile.c2
-rw-r--r--c/src/libfs/ChangeLog5
-rw-r--r--c/src/libfs/src/imfs/memfile.c2
-rw-r--r--cpukit/libfs/ChangeLog5
-rw-r--r--cpukit/libfs/src/imfs/memfile.c2
6 files changed, 21 insertions, 0 deletions
diff --git a/c/src/exec/libfs/ChangeLog b/c/src/exec/libfs/ChangeLog
index 3f8aae5fee..d786838241 100644
--- a/c/src/exec/libfs/ChangeLog
+++ b/c/src/exec/libfs/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2000-11-17 Jennifer Averret <jennifer@OARcorp.com>
* src/imfs/imfs_eval.c: Always return imaginary node at mount points.
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);
diff --git a/c/src/libfs/ChangeLog b/c/src/libfs/ChangeLog
index 3f8aae5fee..d786838241 100644
--- a/c/src/libfs/ChangeLog
+++ b/c/src/libfs/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2000-11-17 Jennifer Averret <jennifer@OARcorp.com>
* src/imfs/imfs_eval.c: Always return imaginary node at mount points.
diff --git a/c/src/libfs/src/imfs/memfile.c b/c/src/libfs/src/imfs/memfile.c
index 64dab775f0..890f2aebc1 100644
--- a/c/src/libfs/src/imfs/memfile.c
+++ b/c/src/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);
diff --git a/cpukit/libfs/ChangeLog b/cpukit/libfs/ChangeLog
index 3f8aae5fee..d786838241 100644
--- a/cpukit/libfs/ChangeLog
+++ b/cpukit/libfs/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2000-11-17 Jennifer Averret <jennifer@OARcorp.com>
* src/imfs/imfs_eval.c: Always return imaginary node at mount points.
diff --git a/cpukit/libfs/src/imfs/memfile.c b/cpukit/libfs/src/imfs/memfile.c
index 64dab775f0..890f2aebc1 100644
--- a/cpukit/libfs/src/imfs/memfile.c
+++ b/cpukit/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);