Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Keep valgrind happy
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/xml/security/trunk@351059 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Berin Lautenbach committed Jun 20, 2004
1 parent 2ae5412 commit 5837c44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion c/src/utils/XSECDOMUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ XMLCh * cleanURIEscapes(const XMLCh * str) {

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;
Expand All @@ -707,6 +708,9 @@ XMLCh * generateId(unsigned int bytes) {
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,
Expand Down

0 comments on commit 5837c44

Please sign in to comment.