Bug 1151506 - Null-check the count parameter in GetConstantCount. r=froydnj, a=sledru
authorDavid Major <dmajor@mozilla.com>
Wed, 24 Jun 2015 09:07:11 -0700
changeset 253642 1e9835314fe82d0c11e6b020ea236c2bca276bd6
parent 253641 470f4457f01d17cec6b558daf862c15d13c1d063
child 253643 dc755335675692c7ed47a905836cc78f8a4857c5
push id4828
push userryanvm@gmail.com
push dateWed, 24 Jun 2015 20:57:41 +0000
treeherdermozilla-esr52@1e9835314fe8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, sledru
bugs1151506
milestone39.0
Bug 1151506 - Null-check the count parameter in GetConstantCount. r=froydnj, a=sledru CLOSED TREE
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)
 {