diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2010-11-17 15:08:53 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2010-11-17 15:08:53 (GMT) |
commit | f396947f6466d6a58796bf3a5147acf1ccb8bad8 (patch) | |
tree | 60970c82d9e1fbf3dc17f81352b7369e9b1156fe /src/H5Fio.c | |
parent | 10c3eb0a9fc87e6005c4dffb3dd078c37f584d26 (diff) | |
download | hdf5-f396947f6466d6a58796bf3a5147acf1ccb8bad8.zip hdf5-f396947f6466d6a58796bf3a5147acf1ccb8bad8.tar.gz hdf5-f396947f6466d6a58796bf3a5147acf1ccb8bad8.tar.bz2 |
[svn-r19800] Purpose:
Add additional error checking to catch erroneous user input.
Description:
Attempting to retrieve a links's name by index in the case
where the link is external and the file that the object is
located in doesn't exist was causing a segmentation fault
(in production) and an assertion failure (in debug).
The segfault wasn't occuring until the metadata accumulator
attempted a write, so I've added error checking higher in
the pipeline in H5O_protect (where there was previously just
an assert) to catch this. I've also added additional asserts
in the H5F layer where there were none.
Additionally, I added another case to the links.c test to
test that this fails gracefully instead of segfaulting or
asserting out.
Tested:
h5committest and gandalf (mac os x)
Diffstat (limited to 'src/H5Fio.c')
-rw-r--r-- | src/H5Fio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Fio.c b/src/H5Fio.c index 231c4c9..c8c75b2 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -102,6 +102,7 @@ H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, HDassert(f); HDassert(f->shared); HDassert(buf); + HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if(H5F_addr_le(f->shared->tmp_addr, (addr + size))) @@ -146,6 +147,7 @@ HDfprintf(stderr, "%s: write to addr = %a, size = %Zu\n", FUNC, addr, size); HDassert(f->shared); HDassert(f->intent & H5F_ACC_RDWR); HDassert(buf); + HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if(H5F_addr_le(f->shared->tmp_addr, (addr + size))) |