You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by bl...@apache.org on 2004/06/20 13:26:37 UTC
cvs commit: xml-security/c/src/utils XSECDOMUtils.cpp
blautenb 2004/06/20 04:26:37
Modified: c/src/utils XSECDOMUtils.cpp
Log:
Keep valgrind happy
Revision Changes Path
1.22 +6 -2 xml-security/c/src/utils/XSECDOMUtils.cpp
Index: XSECDOMUtils.cpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/utils/XSECDOMUtils.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- XSECDOMUtils.cpp 19 Jun 2004 04:02:07 -0000 1.21
+++ XSECDOMUtils.cpp 20 Jun 2004 11:26:37 -0000 1.22
@@ -683,7 +683,8 @@
void makeHexByte(XMLCh * h, unsigned char b) {
- unsigned char toConvert = (b & 0xf0) >> 4;
+ unsigned char toConvert = (b & 0xf0);
+ toConvert = (toConvert >> 4);
if (toConvert < 10)
h[0] = chDigit_0 + toConvert;
@@ -707,6 +708,9 @@
unsigned int toGen = (bytes > 128 ? 16 : bytes);
// Get the appropriate amount of random data
+ // Need to zeroise to ensure valgrind is happy
+ memset(b, 0, 128);
+ memset(id, 0, sizeof(id));
if (XSECPlatformUtils::g_cryptoProvider->getRandom(b, toGen) != toGen) {
throw XSECException(XSECException::CryptoProviderError,