bug 994932 - fix error checking in GetOCSPResponseForType r=retornam
authorDavid Keeler <dkeeler@mozilla.com>
Tue, 15 Apr 2014 14:21:08 -0700
changeset 197214 c9fabef8ea0e843843a2c80b43caeeba25f8b6ee
parent 197213 2c22636dd877eedd42d073fa96acb10a66c2875e
child 197215 b54fdf8bb4860ced8f64b7540485157b69ebed11
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersretornam
bugs994932
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 994932 - fix error checking in GetOCSPResponseForType r=retornam
security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp
--- a/security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp
+++ b/security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp
@@ -134,13 +134,17 @@ GetOCSPResponseForType(OCSPResponseType 
 
   SECItem* response = CreateEncodedOCSPResponse(context);
   if (!response) {
     PrintPRError("CreateEncodedOCSPResponse failed");
     return nullptr;
   }
 
   SECItemArray* arr = SECITEM_AllocArray(aArena, nullptr, 1);
-  arr->items[0].data = response ? response->data : nullptr;
-  arr->items[0].len = response ? response->len : 0;
+  if (!arr) {
+    PrintPRError("SECITEM_AllocArray failed");
+    return nullptr;
+  }
+  arr->items[0].data = response->data;
+  arr->items[0].len = response->len;
 
   return arr;
 }