oleaut32: Check pointer in IPicture_get_Attributes.
authorNikolay Sivov <bunglehead@gmail.com>
Mon, 5 Jan 2009 21:40:07 +0000 (00:40 +0300)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 6 Jan 2009 11:42:49 +0000 (12:42 +0100)
dlls/oleaut32/olepicture.c
dlls/oleaut32/tests/olepicture.c

index e57effe69b7978bb537f661a693f8d06ad814ff7..3d0af78734d8e9a487dc072143a0dd9b01deec16 100644 (file)
@@ -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:
index ba59b50f555cb8139f60c63696ad5aa64247da59..7bff9b0a64371ec65ee5bcfa90a9fa58d700261c 100644 (file)
@@ -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);