diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
commit | 412e908082a361d0fd9591eab939e96a882212f1 (patch) | |
tree | 11726052ae08f13dc5a05a82cbce870758580aeb /core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp | |
parent | 96660d6f382204339d6b1aadc3913303d436e252 (diff) | |
download | pdfium-412e908082a361d0fd9591eab939e96a882212f1.tar.xz |
Merge to XFA: Get rid of most instance of 'foo == NULL'
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1520063002 .
(cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff)
Review URL: https://codereview.chromium.org/1528763003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp index d2379fea6c..0ee0d9a3e8 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp @@ -115,14 +115,14 @@ static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, keylen = 0; if (Version >= 4) { CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict("CF"); - if (pCryptFilters == NULL) { + if (!pCryptFilters) { return FALSE; } if (name == "Identity") { cipher = FXCIPHER_NONE; } else { CPDF_Dictionary* pDefFilter = pCryptFilters->GetDict(name); - if (pDefFilter == NULL) { + if (!pDefFilter) { return FALSE; } int nKeyBits = 0; @@ -329,7 +329,7 @@ FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword( if (FXSYS_memcmp(digest, pkey, 32) != 0) { return FALSE; } - if (key == NULL) { + if (!key) { return TRUE; } if (m_Revision >= 6) { @@ -399,7 +399,7 @@ int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password, return AES256_CheckPassword(password, size, bOwner, key); } uint8_t keybuf[32]; - if (key == NULL) { + if (!key) { key = keybuf; } if (bOwner) { @@ -541,7 +541,7 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, if (!LoadDict(pEncryptDict, type, cipher, key_len)) { return; } - if (bDefault && (owner_pass == NULL || owner_size == 0)) { + if (bDefault && (!owner_pass || owner_size == 0)) { owner_pass = user_pass; owner_size = user_size; } |