[2/2] oleaut32: Check pointer in IPicture_get_Attributes
Nikolay Sivov
bunglehead at gmail.com
Mon Jan 5 15:50:34 CST 2009
Changelog:
- as tested on WinXP SP2 get_Attributes checks for NULL pointer
>From 961a9905caa84ae68e28d7b8d5326d73e4aefcc7 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Tue, 6 Jan 2009 00:40:07 +0300
Subject: Check pointer in IPicture_get_Attributes
---
dlls/oleaut32/olepicture.c | 4 ++++
dlls/oleaut32/tests/olepicture.c | 3 +++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index e57effe..3d0af78 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -842,6 +842,10 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
{
OLEPictureImpl *This = (OLEPictureImpl *)iface;
TRACE("(%p)->(%p).\n", This, pdwAttr);
+
+ if(!pdwAttr)
+ return E_POINTER;
+
*pdwAttr = 0;
switch (This->desc.picType) {
case PICTYPE_UNINITIALIZED:
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
index ba59b50..7bff9b0 100644
--- a/dlls/oleaut32/tests/olepicture.c
+++ b/dlls/oleaut32/tests/olepicture.c
@@ -663,6 +663,9 @@ static void test_get_Attributes(void)
ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08x\n", hres);
ok(type == PICTYPE_UNINITIALIZED, "Expected type = PICTYPE_UNINITIALIZED, got = %d\n", type);
+ hres = IPicture_get_Attributes(pic, NULL);
+ ole_expect(hres, E_POINTER);
+
attr = 0xdeadbeef;
hres = IPicture_get_Attributes(pic, &attr);
ole_expect(hres, S_OK);
--
1.5.6.5
More information about the wine-patches
mailing list