diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-10-17 20:46:57 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-10-17 20:46:57 (GMT) |
commit | 2011215517e50ae231f89c9d24ce826d76315e00 (patch) | |
tree | 1a1f842218cb64d9cf21eaee26437c64676ad213 /src/H5R.c | |
parent | bfd52032e36f265c3a2829595a29f480903e9b30 (diff) | |
download | hdf5-2011215517e50ae231f89c9d24ce826d76315e00.zip hdf5-2011215517e50ae231f89c9d24ce826d76315e00.tar.gz hdf5-2011215517e50ae231f89c9d24ce826d76315e00.tar.bz2 |
[svn-r2689] Purpose:
Bug fix.
Description:
Previously, it has been possible to dereference deleted objects in a file.
Obviously, this is incorrect and could cause all sorts of problems if the
object being dereferenced had been partially over-written with other
information. - This is documented in Bug #493.
Solution:
Check the link count for objects being dereferenced and don't allow any
objects with link counts of zero to be dereferenced.
This fixes bug #493.
Platforms tested:
FreeBSD 4.1.1 (hawkwind)
Diffstat (limited to 'src/H5R.c')
-rw-r--r-- | src/H5R.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -409,6 +409,10 @@ H5R_dereference(H5F_t *file, H5R_type_t ref_type, void *_ref) "internal error (unknown reference type)"); } /* end switch */ + /* Check to make certain that this object hasn't been deleted since the reference was created */ + if(H5O_link(&ent,0)<=0) + HRETURN_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object"); + /* Open the dataset object */ oid_type=H5G_get_type(&ent); switch(oid_type) { |