Juan Lang : ole32: Only read known format ids when attempting to read summary information.

Alexandre Julliard julliard at winehq.org
Tue May 25 12:06:08 CDT 2010


Module: wine
Branch: master
Commit: c94b2687d223100300b61628a77fe942e4f42121
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c94b2687d223100300b61628a77fe942e4f42121

Author: Juan Lang <juan.lang at gmail.com>
Date:   Mon May 24 12:11:22 2010 -0700

ole32: Only read known format ids when attempting to read summary information.

---

 dlls/ole32/stg_prop.c       |    7 +++++++
 dlls/ole32/tests/stg_prop.c |    1 -
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index b3362bc..f887d10 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1314,6 +1314,13 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
     hr = PropertyStorage_ReadFmtIdOffsetFromStream(This->stm, &fmtOffset);
     if (FAILED(hr))
         goto end;
+    if (!IsEqualGUID(&fmtOffset.fmtid, &FMTID_DocSummaryInformation) &&
+        !IsEqualGUID(&fmtOffset.fmtid, &FMTID_SummaryInformation))
+    {
+        WARN("not reading unknown fmtid %s\n", debugstr_guid(&fmtOffset.fmtid));
+        hr = S_FALSE;
+        goto end;
+    }
     if (fmtOffset.dwOffset > stat.cbSize.u.LowPart)
     {
         WARN("invalid offset %d (stream length is %d)\n", fmtOffset.dwOffset,
diff --git a/dlls/ole32/tests/stg_prop.c b/dlls/ole32/tests/stg_prop.c
index 4e5fde7..dff3361 100644
--- a/dlls/ole32/tests/stg_prop.c
+++ b/dlls/ole32/tests/stg_prop.c
@@ -333,7 +333,6 @@ static void testProps(void)
 
     hr = IPropertySetStorage_Open(propSetStorage, &anyOldGuid,
      STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &propertyStorage);
-    todo_wine
     ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08x\n", hr);
 
     spec.ulKind = PRSPEC_PROPID;




More information about the wine-cvs mailing list