[libxslt] Null-terminate result string of cry:rc4_decrypt
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Null-terminate result string of cry:rc4_decrypt
- Date: Thu, 6 Sep 2012 12:28:25 +0000 (UTC)
commit 3195073c740be579892c08cfc02efeae1a1c0dbd
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Tue Jul 31 21:27:51 2012 +0200
Null-terminate result string of cry:rc4_decrypt
For https://bugzilla.gnome.org/show_bug.cgi?id=675917
The string wasn't 0 terminated
libexslt/crypto.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libexslt/crypto.c b/libexslt/crypto.c
index e2700d6..42ac6c5 100644
--- a/libexslt/crypto.c
+++ b/libexslt/crypto.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]