Jactry Zeng : mshtml: Return E_POINTER when p is NULL in get_nsstyle_pixel_val.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 9 14:09:52 CDT 2014


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

Author: Jactry Zeng <wine at jactry.com>
Date:   Tue Sep  9 18:50:25 2014 +0800

mshtml: Return E_POINTER when p is NULL in get_nsstyle_pixel_val.

---

 dlls/mshtml/htmlstyle.c   | 3 +++
 dlls/mshtml/tests/style.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index f098cb0..170db72 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -684,6 +684,9 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
     nsAString str_value;
     HRESULT hres;
 
+    if(!p)
+        return E_POINTER;
+
     nsAString_Init(&str_value, NULL);
 
     hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 2204c5a..64b4fe9 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -1164,6 +1164,9 @@ static void test_body_style(IHTMLStyle *style)
     ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
     ok(l == 6, "pixelLeft = %d\n", l);
 
+    hres = IHTMLStyle_get_pixelLeft(style, NULL);
+    ok(hres == E_POINTER, "get_pixelLeft failed: %08x\n", hres);
+
     V_VT(&v) = VT_EMPTY;
     hres = IHTMLStyle_get_left(style, &v);
     ok(hres == S_OK, "get_left failed: %08x\n", hres);




More information about the wine-cvs mailing list