Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <time.h> 7 #include <time.h>
8 #include "../../../include/fpdfapi/fpdf_parser.h" 8 #include "../../../include/fpdfapi/fpdf_parser.h"
9 #include "../../../include/fdrm/fx_crypt.h" 9 #include "../../../include/fdrm/fx_crypt.h"
10 const uint8_t defpasscode[32] = { 10 const uint8_t defpasscode[32] = {
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 DecryptStream(context, (const uint8_t*)str, str.GetLength(), dest_buf); 1033 DecryptStream(context, (const uint8_t*)str, str.GetLength(), dest_buf);
1034 DecryptFinish(context, dest_buf); 1034 DecryptFinish(context, dest_buf);
1035 str = dest_buf; 1035 str = dest_buf;
1036 } 1036 }
1037 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() { 1037 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() {
1038 m_pAESContext = NULL; 1038 m_pAESContext = NULL;
1039 m_Cipher = FXCIPHER_NONE; 1039 m_Cipher = FXCIPHER_NONE;
1040 m_KeyLen = 0; 1040 m_KeyLen = 0;
1041 } 1041 }
1042 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() { 1042 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() {
1043 if (m_pAESContext) {
1044 FX_Free(m_pAESContext); 1043 FX_Free(m_pAESContext);
1045 }
1046 } 1044 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698