Nikolay Sivov : oleaut32: Check pointer in IPicture::get_Type.
Alexandre Julliard
julliard at winehq.org
Wed Jan 7 10:57:15 CST 2009
Module: wine
Branch: master
Commit: b91f4a3dae3bfac2f23a345a251bd5a7381add81
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b91f4a3dae3bfac2f23a345a251bd5a7381add81
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed Jan 7 09:31:00 2009 +0300
oleaut32: Check pointer in IPicture::get_Type.
---
dlls/oleaut32/olepicture.c | 4 ++++
dlls/oleaut32/tests/olepicture.c | 14 ++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 51423a2..a0f1855 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -595,6 +595,10 @@ static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface,
{
OLEPictureImpl *This = (OLEPictureImpl *)iface;
TRACE("(%p)->(%p): type is %d\n", This, ptype, This->desc.picType);
+
+ if(!ptype)
+ return E_POINTER;
+
*ptype = This->desc.picType;
return S_OK;
}
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
index 6cf80b7..ee13227 100644
--- a/dlls/oleaut32/tests/olepicture.c
+++ b/dlls/oleaut32/tests/olepicture.c
@@ -687,6 +687,19 @@ static void test_get_Handle(void)
IPicture_Release(pic);
}
+static void test_get_Type(void)
+{
+ IPicture *pic;
+ HRESULT hres;
+
+ OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (VOID**)&pic);
+
+ hres = IPicture_get_Type(pic, NULL);
+ ole_expect(hres, E_POINTER);
+
+ IPicture_Release(pic);
+}
+
START_TEST(olepicture)
{
hOleaut32 = GetModuleHandleA("oleaut32.dll");
@@ -716,6 +729,7 @@ START_TEST(olepicture)
test_Render();
test_get_Attributes();
test_get_Handle();
+ test_get_Type();
}
More information about the wine-cvs
mailing list