Bug 1151506 - Null-check the count parameter in GetConstantCount. r=froydnj, a=lizzard
authorDavid Major <dmajor@mozilla.com>
Wed, 24 Jun 2015 09:07:11 -0700
changeset 275186 cfc6f3c1c1f6a5e1faff52ca19a3ddd734d33420
parent 275185 f1107d82994658de990718a2b8746e07f39b4c6a
child 275187 6c7c1fd1f20291fcac5c7f1773fc0a5f215b1903
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, lizzard
bugs1151506
milestone40.0a2
Bug 1151506 - Null-check the count parameter in GetConstantCount. r=froydnj, a=lizzard
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)
 {