diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index a993702eaea..5a75e2b3889 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -2016,7 +2016,7 @@ static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
/* overflow can only be one of the follow values. */
- if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
+ if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
{
return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 6c03b0e678e..49f5ab18cb6 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -3441,6 +3441,16 @@ static void test_default_style(IHTMLStyle *style)
ok(!strcmp_wa(str, "auto"), "str=%s\n", wine_dbgstr_w(str));
SysFreeString(str);
+ str = a2bstr("");
+ hres = IHTMLStyle_put_overflow(style, str);
+ ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
+ SysFreeString(str);
+
+ hres = IHTMLStyle_get_overflow(style, &str);
+ ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
+ ok(!str, "str=%s\n", wine_dbgstr_w(str));
+ SysFreeString(str);
+
/* restore overflow default */
hres = IHTMLStyle_put_overflow(style, sOverflowDefault);
ok(hres == S_OK, "put_overflow failed: %08x\n", hres);