summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-08-18 18:45:29 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-08-18 18:45:29 (GMT)
commitd86efabc13b9f37562236fdc0f9113c7a63d8880 (patch)
tree9c7e835e901d927d2c5bb8be3890d2d2728e9242 /src
parent200f4c079faea2b154f889bfcf991a750a5aec70 (diff)
downloadhdf5-d86efabc13b9f37562236fdc0f9113c7a63d8880.zip
hdf5-d86efabc13b9f37562236fdc0f9113c7a63d8880.tar.gz
hdf5-d86efabc13b9f37562236fdc0f9113c7a63d8880.tar.bz2
[svn-r9107] Purpose: Bug fix
Description: In H5O_fill_new_decode, it tries to read message size(-1) when fill value is undefined for version 1. During UINT32DECODE, if the machine is 64-bit, a value 0x00000000ffffffff is returned, which is like a valid value. Solution: Don't decode message size if fill value is undefined, simply assign -1 to message size. Platforms tested: h5committest.
Diffstat (limited to 'src')
-rw-r--r--src/H5Ofill.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index d7f338b..152e144 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -150,8 +150,8 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p,
/* Whether fill value is defined */
mesg->fill_defined = *p++;
- /* Check for version of fill value message */
- if(version==H5O_FILL_VERSION) {
+ /* Only decode fill value information if one is defined */
+ if(mesg->fill_defined) {
UINT32DECODE(p, mesg->size);
if (mesg->size>0) {
H5_CHECK_OVERFLOW(mesg->size,ssize_t,size_t);
@@ -160,22 +160,9 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p,
HDmemcpy(mesg->buf, p, (size_t)mesg->size);
}
} /* end if */
- else {
- /* Only decode fill value information if one is defined */
- if(mesg->fill_defined) {
- UINT32DECODE(p, mesg->size);
- if (mesg->size>0) {
- H5_CHECK_OVERFLOW(mesg->size,ssize_t,size_t);
- if (NULL==(mesg->buf=H5MM_malloc((size_t)mesg->size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value");
- HDmemcpy(mesg->buf, p, (size_t)mesg->size);
- }
- } /* end if */
- else
- mesg->size=(-1);
- } /* end else */
-
-
+ else
+ mesg->size=(-1);
+
/* Set return value */
ret_value = (void*)mesg;