Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > b2a9cff828d5d72e3b98199430d30945 > files > 5

hdf5-1.8.13-4.1.mga5.src.rpm

commit bfae878d8f2f65bc5f22f0d4bb314f326278ba7b
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date:   Fri Jul 1 10:31:44 2016 -0500

    [svn-r30131] Fix bug reported by Cisco Talos TALOS-CAN-0178. Added check for a message that
    should not be sharable being marked as sharable on disk, returns failure in
    this case. Needs testing.
    
    Tested: ummon

Index: hdf5/src/H5Ocache.c
===================================================================
--- hdf5.orig/src/H5Ocache.c
+++ hdf5/src/H5Ocache.c
@@ -1134,6 +1134,10 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t
             HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
         if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && !(flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN))
             HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
+        if((flags & H5O_MSG_FLAG_SHAREABLE)
+                && H5O_msg_class_g[id]
+                && !(H5O_msg_class_g[id]->share_flags & H5O_SHARE_IS_SHARABLE))
+            HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "message of unsharable class flagged as sharable")
 
         /* Reserved bytes/creation index */
         if(oh->version == H5O_VERSION_1)
Index: hdf5/src/H5Opkg.h
===================================================================
--- hdf5.orig/src/H5Opkg.h
+++ hdf5/src/H5Opkg.h
@@ -201,6 +201,7 @@
                                                                               \
         /* Set the message's "shared info", if it's shareable */	      \
         if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) {                           \
+            HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE);          \
             H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \
         } /* end if */                                                        \
                                                                               \