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

Unified Diff: third_party/libxslt/libexslt/crypto.c

Issue 1193533007: Upgrade to libxml 2.9.2 and libxslt 1.1.28 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no iconv Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxslt/libexslt/common.c ('k') | third_party/libxslt/libexslt/date.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libexslt/crypto.c
diff --git a/third_party/libxslt/libexslt/crypto.c b/third_party/libxslt/libexslt/crypto.c
index e2700d6b5f23557dc8b78957743ef9f06337a44a..d142bb65fef7273305a8673d95e9a70d9488498e 100644
--- a/third_party/libxslt/libexslt/crypto.c
+++ b/third_party/libxslt/libexslt/crypto.c
@@ -27,7 +27,7 @@
#define MD5_DIGEST_LENGTH 16
#define SHA1_DIGEST_LENGTH 20
-/* gcrypt rc4 can do 256 bit keys, but cryptoapi limit
+/* gcrypt rc4 can do 256 bit keys, but cryptoapi limit
seems to be 128 for the default provider */
#define RC4_KEY_LENGTH 128
@@ -48,7 +48,7 @@
* @hex: buffer to store hex version of blob
* @hexlen: length of buffer to store hex version of blob
*
- * Helper function which encodes a binary blob as hex.
+ * Helper function which encodes a binary blob as hex.
*/
static void
exsltCryptoBin2Hex (const unsigned char *bin, int binlen,
@@ -357,7 +357,7 @@ exsltCryptoGcryptInit (void) {
* @msglen: length of text to be hashed
* @dest: buffer to place hash result
*
- * Helper function which hashes a message using MD4, MD5, or SHA1.
+ * Helper function which hashes a message using MD4, MD5, or SHA1.
* using gcrypt
*/
static void
@@ -752,7 +752,7 @@ exsltCryptoRc4DecryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
ret_len = exsltCryptoHex2Bin (str, str_len, bin, bin_len);
/* decrypt the binary blob */
- ret = xmlMallocAtomic (ret_len);
+ ret = xmlMallocAtomic (ret_len + 1);
if (ret == NULL) {
xsltTransformError(tctxt, NULL, tctxt->inst,
"exsltCryptoRc4EncryptFunction: Failed to allocate result\n");
@@ -761,6 +761,7 @@ exsltCryptoRc4DecryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
goto done;
}
PLATFORM_RC4_DECRYPT (ctxt, padkey, bin, ret_len, ret, ret_len);
+ ret[ret_len] = 0;
xmlXPathReturnString (ctxt, ret);
« no previous file with comments | « third_party/libxslt/libexslt/common.c ('k') | third_party/libxslt/libexslt/date.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698