summaryrefslogtreecommitdiff
path: root/gfpcrypt.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-18 15:32:28 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-18 15:32:28 -0500
commit6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e (patch)
treef0d873d0b377a91dce5ee384e60426ef57efc92b /gfpcrypt.h
parentd2fda9bd4231a7dfcb44e59150f11246d992843f (diff)
downloadcryptopp-git-6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e.tar.gz
Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 (Coverity rollup)
Diffstat (limited to 'gfpcrypt.h')
-rw-r--r--gfpcrypt.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gfpcrypt.h b/gfpcrypt.h
index 75d260d1..114fe8da 100644
--- a/gfpcrypt.h
+++ b/gfpcrypt.h
@@ -524,7 +524,9 @@ public:
ConstByteArrayParameter encodingParameters;
parameters.GetValue(Name::EncodingParameters(), encodingParameters);
- xorbuf(ciphertext, plaintext, cipherKey, plaintextLength);
+ if (plaintextLength) // Coverity finding
+ xorbuf(ciphertext, plaintext, cipherKey, plaintextLength);
+
MAC mac(macKey);
mac.Update(ciphertext, plaintextLength);
mac.Update(encodingParameters.begin(), encodingParameters.size());
@@ -566,7 +568,9 @@ public:
if (!mac.Verify(ciphertext + plaintextLength))
return DecodingResult();
- xorbuf(plaintext, ciphertext, cipherKey, plaintextLength);
+ if (plaintextLength) // Coverity finding
+ xorbuf(plaintext, ciphertext, cipherKey, plaintextLength);
+
return DecodingResult(plaintextLength);
}