Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1258)

Unified Diff: ui/views/accessibility/native_view_accessibility_win.cc

Issue 872683005: Add missing NULL checks to NativeViewAccessibilityWin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/accessibility/native_view_accessibility_win.cc
diff --git a/ui/views/accessibility/native_view_accessibility_win.cc b/ui/views/accessibility/native_view_accessibility_win.cc
index 8dddc3c30c13993f48bd3f3dcebc09ffddcab6b4..1255f10068534e656c3f878202aa643f52d3fa0d 100644
--- a/ui/views/accessibility/native_view_accessibility_win.cc
+++ b/ui/views/accessibility/native_view_accessibility_win.cc
@@ -790,6 +790,12 @@ STDMETHODIMP NativeViewAccessibilityWin::accSelect(
STDMETHODIMP NativeViewAccessibilityWin::get_accHelp(
VARIANT var_id, BSTR* help) {
+ if (!IsValidId(var_id) || !help)
+ return E_INVALIDARG;
+
+ if (!view_)
+ return E_FAIL;
+
base::string16 temp = base::UTF8ToUTF16(view_->GetClassName());
*help = SysAllocString(temp.c_str());
return S_OK;
@@ -1183,6 +1189,12 @@ STDMETHODIMP NativeViewAccessibilityWin::QueryService(
STDMETHODIMP NativeViewAccessibilityWin::GetPatternProvider(
PATTERNID id, IUnknown** provider) {
+ if (!view_)
+ return E_FAIL;
+
+ if (!provider)
+ return E_INVALIDARG;
+
DVLOG(1) << "In Function: "
<< __FUNCTION__
<< " for pattern id: "
@@ -1204,6 +1216,12 @@ STDMETHODIMP NativeViewAccessibilityWin::GetPatternProvider(
STDMETHODIMP NativeViewAccessibilityWin::GetPropertyValue(PROPERTYID id,
VARIANT* ret) {
+ if (!view_)
+ return E_FAIL;
+
+ if (!ret)
+ return E_INVALIDARG;
+
DVLOG(1) << "In Function: "
<< __FUNCTION__
<< " for property id: "
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698