From 387257dd2c68b0c29780838b42599d64e394ab0d Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Tue, 9 Sep 2014 18:50:25 +0800 Subject: [PATCH] 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 f098cb0acba..170db7230ce 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 2204c5a8d13..64b4fe97c6e 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); -- 2.11.4.GIT