Commit 3356924c authored by Yukawa@chromium.org's avatar Yukawa@chromium.org

Fix a NULL pointer access bug in TSFTextStore

RequestSupportedAttrs should fail when |text_input_client_| is
not available. Otherwise, we will see an access violation.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/23819038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222071 0039d316-1c4b-4281-b951-d872f2087c98
parent 5ca4d040
...@@ -585,6 +585,8 @@ STDMETHODIMP TSFTextStore::RequestSupportedAttrs( ...@@ -585,6 +585,8 @@ STDMETHODIMP TSFTextStore::RequestSupportedAttrs(
const TS_ATTRID* attribute_buffer) { const TS_ATTRID* attribute_buffer) {
if (!attribute_buffer) if (!attribute_buffer)
return E_INVALIDARG; return E_INVALIDARG;
if (!text_input_client_)
return E_FAIL;
// We support only input scope attribute. // We support only input scope attribute.
for (size_t i = 0; i < attribute_buffer_size; ++i) { for (size_t i = 0; i < attribute_buffer_size; ++i) {
if (IsEqualGUID(GUID_PROP_INPUTSCOPE, attribute_buffer[i])) if (IsEqualGUID(GUID_PROP_INPUTSCOPE, attribute_buffer[i]))
...@@ -601,6 +603,8 @@ STDMETHODIMP TSFTextStore::RetrieveRequestedAttrs( ...@@ -601,6 +603,8 @@ STDMETHODIMP TSFTextStore::RetrieveRequestedAttrs(
return E_INVALIDARG; return E_INVALIDARG;
if (!attribute_buffer) if (!attribute_buffer)
return E_INVALIDARG; return E_INVALIDARG;
if (!text_input_client_)
return E_UNEXPECTED;
// We support only input scope attribute. // We support only input scope attribute.
*attribute_buffer_copied = 0; *attribute_buffer_copied = 0;
if (attribute_buffer_size == 0) if (attribute_buffer_size == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment