projects
/
platform
/
upstream
/
libxslt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7816b65
)
Null-terminate result string of cry:rc4_decrypt
author
Nick Wellnhofer
<wellnhofer@aevum.de>
Tue, 31 Jul 2012 19:27:51 +0000
(21:27 +0200)
committer
Daniel Veillard
<veillard@redhat.com>
Thu, 6 Sep 2012 12:18:55 +0000
(20:18 +0800)
For https://bugzilla.gnome.org/show_bug.cgi?id=675917
The string wasn't 0 terminated
libexslt/crypto.c
patch
|
blob
|
history
diff --git
a/libexslt/crypto.c
b/libexslt/crypto.c
index
e2700d6
..
42ac6c5
100644
(file)
--- 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);