Bug 1151506 - Null-check the count parameter in GetConstantCount. r=froydnj
authorDavid Major <dmajor@mozilla.com>
Wed, 24 Jun 2015 09:07:11 -0700
changeset 268235 98a929f5873078c6c21b0e986b0f84eb54eeaeba
parent 268234 2d456668f53c3e58c51a163723653205314ae11c
child 268236 1959e594ac43fd94bc15eca23acc34b3c2a044be
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1151506
milestone41.0a1
Bug 1151506 - Null-check the count parameter in GetConstantCount. r=froydnj
xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
--- a/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
@@ -185,16 +185,19 @@ xptiInterfaceEntry::GetMethodCount(uint1
 }
 
 nsresult
 xptiInterfaceEntry::GetConstantCount(uint16_t* count)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
+    if(!count)
+        return NS_ERROR_UNEXPECTED;
+
     *count = mConstantBaseIndex + 
              mDescriptor->num_constants;
     return NS_OK;
 }
 
 nsresult
 xptiInterfaceEntry::GetMethodInfo(uint16_t index, const nsXPTMethodInfo** info)
 {