From d14751b88b21ce69dd030b693533574b42017d82 Mon Sep 17 00:00:00 2001 From: David Keeler Date: Tue, 15 Apr 2014 14:21:08 -0700 Subject: [PATCH] bug 994932 - fix error checking in GetOCSPResponseForType r=retornam --- .../manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp b/security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp index 75c7b755c7a8..16e8e2c5df1a 100644 --- a/security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp +++ b/security/manager/ssl/tests/unit/tlsserver/lib/OCSPCommon.cpp @@ -139,8 +139,12 @@ GetOCSPResponseForType(OCSPResponseType aORT, CERTCertificate *aCert, } 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; }