text stringlengths 79 3.72M |
|---|
<vulnerable_code> hits = {}
request.get({
uri: require('url').parse(s.url + '/ssl'),
rejectUnauthorized: false
}, function (err, res, body) {
t.equal(err, null)
t.equal(res.statusCode, 200)
})
})
tape('should have referer header by default when following redirect', function (t) {
request.post(... |
<vulnerable_code> }
#define MIN(x,y) (((x)<(y))?(x):(y))
void TNEFFillMapi(TNEFStruct *TNEF, BYTE *data, DWORD size, MAPIProps *p);
void SetFlip(void);
int TNEFCodePage STD_ARGLIST {
TNEF->CodePage.size = size;
TNEF->CodePage.data = calloc(size, sizeof(BYTE));
memcpy(TNEF->CodePage.data, data, size);
r... |
<vulnerable_code> :param create_hcatalog_table: Have sqoop create the hcatalog table passed
in or not
:param properties: additional JVM properties passed to sqoop
:param extra_import_options: Extra import options to pass as dict.
If a key doesn't have a value, just pass an empty string to it.... |
<vulnerable_code> "hcatalog_database": "hive_database",
"hcatalog_table": "hive_table",
"properties": {"mapred.map.max.attempts": "1"},
"extra_import_options": {"hcatalog-storage-stanza": '"stored as orcfile"', "show": ""},
"extra_export_options": {"update-key": "id", "update-mode... |
<vulnerable_code> s2 %= BASE;
}
assert(s1 < BASE);
assert(s2 < BASE);
m_s1 = (word16)s1;
m_s2 = (word16)s2;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
s2 %= BASE;
}
CRYPTOPP_ASSERT(s1 < BASE);
CRYPTOPP_ASSERT(s2 < BASE);
m_s1 = (word16)s1;
m_s2 = (word16)s2; |
<vulnerable_code>
for (i=0; i<expCount; i++)
{
assert(expBegin->NotNegative());
exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0));
exponents[i].FindNextWindow();
buckets[i].resize(((size_t) 1) << (exponents[i].windowSize-1), Identity());<commit_title>[PATCH 5/7] Update copyright message<com... |
<vulnerable_code>void AlgorithmParametersBase::operator=(const AlgorithmParametersBase &rhs)
{
CRYPTOPP_UNUSED(rhs);
assert(false);
}
bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const<commit_title>[PATCH 5/7] Update copyright message<commit_description>... |
<vulnerable_code>
void OID::DEREncode(BufferedTransformation &bt) const
{
assert(m_values.size() >= 2);
ByteQueue temp;
temp.Put(byte(m_values[0] * 40 + m_values[1]));
for (size_t i=2; i<m_values.size(); i++)
}
catch (const Exception&)
{
// assert(0);
}
}
}
catch (const Exception&)
{
assert(0);
}
}
<co... |
<vulnerable_code> m_totalFooterLength += length;
break;
default:
assert(false);
}
}
AuthenticateData(outString, length);
break;
default:
assert(false);
}
}
break;
default:
assert(false);
}
m_state = State_KeySet;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>... |
<vulnerable_code> unsigned int b = begin[m_inputPosition++], bitsLeftInSource = 8;
while (true)
{
assert(m_bitsPerChar-m_bitPos >= 0);
unsigned int bitsLeftInTarget = (unsigned int)(m_bitsPerChar-m_bitPos);
m_outBuf[m_bytePos] |= b >> (8-bitsLeftInTarget);
if (bitsLeftInSource >= bitsLeftInTarget)
}
... |
<vulnerable_code>
const time_t endTime = time(NULL);
err = localtime_s(&localTime, &endTime);
assert(err == 0);
err = asctime_s(timeBuf, sizeof(timeBuf), &localTime);
assert(err == 0);
cout << "\nTest ended at " << timeBuf;
#else<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
... |
<vulnerable_code>template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base(bool treeMode, unsigned int digestSize) : m_state(1), m_block(1), m_digestSize(digestSize), m_treeMode(treeMode)
{
assert(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULL, 0, g_nullNameValuePairs);
Restart();
const byte* personal... |
<vulnerable_code> kwl = (word64(k0) << 32) | k1; \
kwr = (word64(k2) << 32) | k3
#define KS_ROUND_0(i) \
assert(IsAlignedOn(CALC_ADDR(ks32, i+EFI(0)),GetAlignmentOf<word64>())); \
assert(IsAlignedOn(CALC_ADDR(ks32, i+EFI(1)),GetAlignmentOf<word64>())); \
*(word64*)(void*)CALC_ADDR(ks32, i+EFI(0)) = kwl; \
*(... |
<vulnerable_code> int i1=8*j+i;
int i2=8*(11-j)+i;
assert(i1<i2);
std::swap(K[i1],K[i2]);
std::swap(K[i1+4],K[i2+4]);<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
int i1=8*j+i;
int i2=8*(11-j)+i;
CRYPTOPP_ASSERT(i1<i2);
std::swap(K[i1],K[i2]);
... |
<vulnerable_code> BlockCipher &cipher = AccessBlockCipher();
m_L = REQUIRED_BLOCKSIZE-1-(int)len;
assert(m_L >= 2);
if (m_L > 8)
m_L = 8;
if (headerLength>0)
{
assert(m_bufferedDataLength == 0);
if (headerLength < ((1<<16) - (1<<8)))
{<commit_title>[PATCH 5/7] Update copyright message<commit_descriptio... |
<vulnerable_code>void ChaCha_Policy<R>::CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length)
{
CRYPTOPP_UNUSED(params);
assert(length == 16 || length == 32);
// "expand 16-byte k" or "expand 32-byte k"
m_state[0] = 0x61707865;
void ChaCha_Policy<R>::CipherResynchronize(byte *keystreamBuffer, ... |
<vulnerable_code>
void CMAC_Base::Update(const byte *input, size_t length)
{
assert((input && length) || !(input || length));
if (!length)
return;
if (length > blockSize)
{
assert(m_counter == 0);
size_t leftOver = 1 + cipher.AdvancedProcessBlocks(m_reg, input, m_reg, length-1, BlockTransformation::BT_DontI... |
<vulnerable_code>
size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const
{
assert(inBlocks);
assert(outBlocks);
assert(length);
size_t blockSize = BlockSize();
size_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncr... |
<vulnerable_code> else if (test == "RandomSign")
{
SignalTestError();
assert(false); // TODO: implement
}
else
{
SignalTestError();
assert(false);
}
}
else
{
SignalTestError();
assert(false);
}
}
while (ss.Pump(64)) {}
ss.PumpAll();
for (int i=0; i<z.length(); i++)
assert(encrypted[i]... |
<vulnerable_code> // sign and verify
byte signature[40];
DSA::Signer signer(dsaPrivateKey);
assert(signer.SignatureLength() == 40);
signer.SignMessage(rng, message, 3, signature);
DSA::Verifier verifier(dsaPublicKey);<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
// sign and v... |
<vulnerable_code>
void EAX_Base::AuthenticateLastHeaderBlock()
{
assert(m_bufferedDataLength == 0);
MessageAuthenticationCode &mac = AccessMAC();
unsigned int blockSize = mac.TagSize();
void EAX_Base::AuthenticateLastFooterBlock(byte *tag, size_t macSize)
{
assert(m_bufferedDataLength == 0);
MessageAuthenticatio... |
<vulnerable_code> }
FieldElement z = m_field->Square(P.x);
assert(P.x == m_field->SquareRoot(z));
P.y = m_field->Divide(m_field->Add(m_field->Multiply(z, m_field->Add(P.x, m_a)), m_b), z);
assert(P.x == m_field->Subtract(m_field->Divide(m_field->Subtract(m_field->Multiply(P.y, z), m_b), z), m_a));
z = m_fie... |
<vulnerable_code> this->SetSubgroupGenerator(G);
// TODO: this fails in practice. Should it throw?
CRYPTOPP_UNUSED(result); assert(result);
StringSource ssN(param.n, true, new HexDecoder);
m_n.Decode(ssN, (size_t)ssN.MaxRetrievable());<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_co... |
<vulnerable_code>{
ArraySink sink(encodedPoint, EncodedPointSize(compressed));
EncodePoint(sink, P, compressed);
assert(sink.TotalPutLength() == EncodedPointSize(compressed));
}
ECP::Point ECP::BERDecodePoint(BufferedTransformation &bt) const
for (i=0; i<expCount; i++)
{
assert(expBegin->NotNegative());
expo... |
<vulnerable_code> byte *representative, size_t representativeBitLength) const
{
CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength), CRYPTOPP_UNUSED(representativeBitLength);
assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize()));
if (repre... |
<vulnerable_code>
template <class T> void DL_FixedBasePrecomputationImpl<T>::Precompute(const DL_GroupPrecomputation<Element> &group, unsigned int maxExpBits, unsigned int storage)
{
assert(m_bases.size() > 0);
assert(storage <= maxExpBits);
if (storage > 1)
{<commit_title>[PATCH 5/7] Update copyright message<comm... |
<vulnerable_code>
m_n = m_p * m_p * m_q;
assert(m_n.BitCount() == (unsigned int)modulusSize);
}
void InvertibleESIGNFunction::BERDecode(BufferedTransformation &bt)
ModularArithmetic modp(m_p);
Integer t = modp.Divide(w0 * r % m_p, m_e * re % m_p);
Integer s = r + t*pq;
assert(s < m_n);
#if 0
using namespace st... |
<vulnerable_code> m_stream->seekg(newPosition);
try
{
assert(!m_waiting);
lword copyMax = end-begin;
size_t blockedBytes = const_cast<FileStore *>(this)->TransferTo2(target, copyMax, channel, blocking);
begin += copyMax;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
m_stre... |
<vulnerable_code> {
FILTER_OUTPUT_MAYBE_MODIFIABLE(1, m_begin, t = (size_t)SaturatingSubtract(m_rangesToSkip.front().position, m_currentMessageBytes), false, modifiable);
assert(t < m_length);
m_begin += t;
m_length -= t;
m_currentMessageBytes += t;
else
{
t = (size_t)SaturatingSubtract(m_ran... |
<vulnerable_code>#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
return AccessPowerUpSelfTestInProgress().GetValue() != NULL;
#else
assert(false); // should not be called
return false;
#endif
}<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_1... |
<vulnerable_code>
static inline void Xor(SecByteBlock &z, const SecByteBlock &x, const SecByteBlock &y)
{
assert(x.size() == y.size());
z.resize(x.size());
xorbuf(z, x, y, x.size());
}
}
else
{
assert(m_test == "Gen");
int modLen = atol(m_bracketString.substr(6).c_str());
std::string &enco... |
<vulnerable_code>inline static void SSE2_Xor16(byte *a, const byte *b, const byte *c)
{
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
assert(IsAlignedOn(a,GetAlignmentOf<__m128i>()));
assert(IsAlignedOn(b,GetAlignmentOf<__m128i>()));
assert(IsAlignedOn(c,GetAlignmentOf<__m128i>()));
*(__m128i *)(void *)a = _mm_xor_si... |
<vulnerable_code> word32 g0=m_modulus, g1=a, g2=a;
word32 v0=0, v1=1, v2=1;
assert(g1);
while (!(g2 & 0x80000000))
{
{
if (g1 < g0 || ((g0^g1) < g0 && (g0^g1) < g1))
{
assert(BitPrecision(g1) <= BitPrecision(g0));
g2 = g1;
v2 = v1;
}
else
{
assert(BitPrecision(g1) > BitPrecision(g0));
g2... |
<vulnerable_code>PolynomialMod2::PolynomialMod2(word value, size_t bitLength)
: reg(BitsToWords(bitLength))
{
assert(value==0 || reg.size()>0);
if (reg.size() > 0)
{
{
#if !defined(NDEBUG)
int x; CRYPTOPP_UNUSED(x);
assert(SafeConvert(n,x));
#endif
if (!reg.size())
GF2NP::Element GF2NP::HalfTrace(const Elemen... |
<vulnerable_code>{
CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength);
CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier);
assert(recoverableMessageLength == 0);
assert(hashIdentifier.second == 0);
const size_t representativeByteLength = BitsToBytes(re... |
<vulnerable_code> keylength = hash.DigestSize();
}
assert(keylength <= blockSize);
memset(AccessIpad()+keylength, 0, blockSize-keylength);
for (unsigned int i=0; i<blockSize; i++)
void HMAC_Base::KeyInnerHash()
{
assert(!m_innerHashKeyed);
HashTransformation &hash = AccessHash();
hash.Update(AccessIpad(), ha... |
<vulnerable_code>#include <unistd.h>
#endif
#include <assert.h>
NAMESPACE_BEGIN(CryptoPP)
static unsigned long unitsPerSecondTable[] = {1, 1000, 1000*1000, 1000*1000*1000};
// When 'unit' is an enum 'Unit', a Clang warning is generated.
assert(static_cast<unsigned int>(unit) < COUNTOF(unitsPerSecondTable));
ret... |
<vulnerable_code> if (!parameters.GetIntValue("RecoveryThreshold", m_threshold))
throw InvalidArgument("RawIDA: missing RecoveryThreshold argument");
assert(m_threshold > 0);
if (m_threshold <= 0)
throw InvalidArgument("RawIDA: RecoveryThreshold must be greater than 0");
else
{
int nShares = parameters.GetI... |
<vulnerable_code>// should use an inline function but macros are still faster in MSVC 4.0
#define DirectMUL(a,b) \
{ \
assert(b <= 0xffff); \
\
word32 p=(word32)low16(a)*b; \
\<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
// should use an inlin... |
<vulnerable_code>
inline static int Increment(word *A, size_t N, word B=1)
{
assert(N);
word t = A[0];
A[0] = t+B;
if (A[0] >= t)
inline static int Decrement(word *A, size_t N, word B=1)
{
assert(N);
word t = A[0];
A[0] = t-B;
if (A[0] <= t)
static word AtomicInverseModPower2(word A)
{
assert(A%2==1);
word... |
<vulnerable_code>
T* dataBuf = this->DataBuf();
byte* data = (byte *)dataBuf;
assert(dataBuf && data);
if (num != 0) // process left over data
{
{
if (input == data)
{
assert(len == blockSize);
HashBlock(dataBuf);
return;
}<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixe... |
<vulnerable_code>
void Keccak::Update(const byte *input, size_t length)
{
assert((input && length) || !(input || length));
if (!length)
return;
<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
void Keccak::Update(const byte *input, size_t length)
{
CRYPTOPP_ASSERT((input && lengt... |
<vulnerable_code>
void xorbuf(byte *buf, const byte *mask, size_t count)
{
assert(buf != NULL);
assert(mask != NULL);
assert(count > 0);
size_t i=0;
if (IsAligned<word32>(buf) && IsAligned<word32>(mask))
void xorbuf(byte *output, const byte *input, const byte *mask, size_t count)
{
assert(output != NULL);
asse... |
<vulnerable_code>
void CFB_ModePolicy::Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount)
{
assert(input);
assert(output);
assert(m_cipher->IsForwardTransformation()); // CFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt
assert(m_feedbackSize == Block... |
<vulnerable_code> unsigned int primeTableSize;
const word16 * primeTable = GetPrimeTable(primeTableSize);
assert(primeTable[primeTableSize-1] >= bound);
unsigned int i;
for (i = 0; primeTable[i]<bound; i++)
if (n <= 3)
return n==2 || n==3;
assert(n>3 && b>1 && b<n-1);
return a_exp_b_mod_c(b, n-1, n)==1;
}
... |
<vulnerable_code> {
if (m_skipBytes)
{
assert(length >= m_skipBytes);
inString += m_skipBytes;
length -= m_skipBytes;
}
if (m_buffer.CurrentSize() > targetSize)
{
assert(!blocking);
m_wasBlocked = true;
m_skipBytes += length;
size_t blockedBytes = UnsignedMin(length, m_buffer.CurrentSize... |
<vulnerable_code>
void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputLength, byte *oaepBlock, size_t oaepBlockLen, const NameValuePairs ¶meters) const
{
assert (inputLength <= MaxUnpaddedLength(oaepBlockLen));
// convert from bit length to byte length
if (oaepBlockLen % 8 != 0)<commi... |
<vulnerable_code>template <class B>
void Panama<B>::Iterate(size_t count, const word32 *p, byte *output, const byte *input, KeystreamOperation operation)
{
assert(IsAlignedOn(m_state,GetAlignmentOf<word32>()));
word32 bstart = m_state[17];
word32 *const aPtr = m_state;
word32 cPtr[17];
void PanamaCipherPolicy<B>::C... |
<vulnerable_code>
#include "pkcspad.h"
#include "misc.h"
#include <assert.h>
NAMESPACE_BEGIN(CryptoPP)
void PKCS_EncryptionPaddingScheme::Pad(RandomNumberGenerator& rng, const byte *input, size_t inputLen, byte *pkcsBlock, size_t pkcsBlockLen, const NameValuePairs& parameters) const
{
CRYPTOPP_UNUSED(parameters);
a... |
<vulnerable_code>template <class T>
typename RingOfPolynomialsOver<T>::Element RingOfPolynomialsOver<T>::Interpolate(const CoefficientType x[], const CoefficientType y[], unsigned int n) const
{
assert(n > 0);
std::vector<CoefficientType> alpha(n);
CalculateAlpha(alpha, x, y, n);
template <class T>
typename RingOfP... |
<vulnerable_code>{
CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength);
CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier);
assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize()));
const size_t u = hashIden... |
<vulnerable_code> i -= current->CurrentSize();
}
assert(i < m_lazyLength);
return m_lazyString[i];
}
<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
i -= current->CurrentSize();
}
CRYPTOPP_ASSERT(i < m_lazyLength);
return m_lazyString[i];
}
|
<vulnerable_code>#if ALL_RDRAND_INTRIN_AVAILABLE
static int ALL_RRI_GenerateBlock(byte *output, size_t size, unsigned int safety)
{
assert((output && size) || !(output || size));
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32
word32 val;
#else
{
if (!safety--)
{
assert(0);
return 0;
}
}
{
if (!s... |
<vulnerable_code>
if (flags & BlockTransformation::BT_ReverseDirection)
{
assert(length % blockSize == 0);
inBlocks += length - blockSize;
xorBlocks += length - blockSize;
outBlocks += length - blockSize;
size_t increment = BLOCKSIZE;
if (flags & BT_ReverseDirection)
{
assert(length % BLOCKSIZE == 0)... |
<vulnerable_code> int modulusSize = 2048;
alg.GetIntValue(Name::ModulusSize(), modulusSize) || alg.GetIntValue(Name::KeySize(), modulusSize);
assert(modulusSize >= 16);
if (modulusSize < 16)
throw InvalidArgument("InvertibleRSAFunction: specified modulus size is too small");
m_e = alg.GetValueWithDefault(Name::... |
<vulnerable_code>
// Signature
Integer s = modn.Multiply(modn.Square(Y), rInv);
assert((e * f * s.Squared()) % m_n == x);
// IEEE P1363, Section 8.2.8 IFSP-RW, p.44
s = STDMIN(s, m_n - s);<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
// Signature
Integer s = modn.Multiply(m... |
<vulnerable_code>void Salsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
assert(length==8);
GetBlock<word32, LittleEndian> get(IV);
get(m_state[14])(m_state[11]);
void XSalsa20_Policy::CipherResynchronize(byte *keys... |
<vulnerable_code>void SEAL_Policy<B>::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(IV), CRYPTOPP_UNUSED(length);
assert(length==4);
m_outsideCounter = IV ? GetWord<word32>(false, BIG_ENDIAN_ORDER, IV) : 0;
m_startCount = m_outsideCoun... |
<vulnerable_code>
void SHA512::Transform(word64 *state, const word64 *data)
{
assert(IsAlignedOn(state, GetAlignmentOf<word64>()));
assert(IsAlignedOn(data, GetAlignmentOf<word64>()));
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)
if (HasSSE2())<commit_title>[PATCH 5/7] Update cop... |
<vulnerable_code>
void SHA3::Update(const byte *input, size_t length)
{
assert((input && length) || !(input || length));
if (!length)
return;
<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
void SHA3::Update(const byte *input, size_t length)
{
CRYPTOPP_ASSERT((input && length) |... |
<vulnerable_code>struct SharkProcessAndXorBlock{ // VC60 workaround: problem with template functions
inline SharkProcessAndXorBlock(const word64 *roundKeys, unsigned int rounds, const byte *inBlock, const byte *xorBlock, byte *outBlock)
{
assert(IsAlignedOn(inBlock,GetAlignmentOf<word64>()));
word64 tmp = *(word64 *... |
<vulnerable_code> }
catch (const Exception&)
{
assert(0);
}
}
}
void Socket::Create(int nType)
{
assert(m_s == INVALID_SOCKET);
m_s = socket(AF_INET, nType, 0);
CheckAndHandleError("socket", m_s);
m_own = true;
#ifdef USE_WINDOWS_STYLE_SOCKETS
# if defined(USE_WINDOWS8_API)
BOOL result = CancelIoEx((H... |
<vulnerable_code>void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(iv), CRYPTOPP_UNUSED(length);
assert(length==16);
word32 a, b, c, d, e;
<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_co... |
<vulnerable_code> if (!length)
return;
}
assert(m_leftOver == 0);
PolicyInterface &policy = this->AccessPolicy();
unsigned int bytesPerIteration = policy.GetBytesPerIteration();
if (!length)
return;
}
assert(m_leftOver == 0);
PolicyInterface &policy = this->AccessPolicy();
unsigned int bytesPerIterat... |
<vulnerable_code>void BTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
CRYPTOPP_UNUSED(xorBlock);
assert(IsAlignedOn(inBlock,GetAlignmentOf<word32>()));
assert(IsAlignedOn(outBlock,GetAlignmentOf<word32>()));
unsigned int n = m_blockSize / 4;
word32 *v = (word32*)(v... |
<vulnerable_code>#include "whrlpool.h"
#include "tiger.h"
#include "smartptr.h"
#include "validate.h"
#include "bench.h"
return dynamic_cast<RandomNumberGenerator&>(s_globalRNG);
}
int CRYPTOPP_API main(int argc, char *argv[])
{
#ifdef _CRTDBG_LEAK_CHECK_DF
// compute MAC
member_ptr<MessageAuthenticationCode>... |
<vulnerable_code>{
#ifdef HAS_WINTHREADS
m_index = TlsAlloc();
assert(m_index != TLS_OUT_OF_INDEXES);
if (m_index == TLS_OUT_OF_INDEXES)
throw Err("TlsAlloc", GetLastError());
#else
m_index = 0;
int error = pthread_key_create(&m_index, NULL);
assert(!error);
if (error)
throw Err("pthread_key_create", error);... |
<vulnerable_code> }
#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
// Don't assert the alignment of testvals. That's what this test is for.
byte testvals[10] = {1,2,2,3,3,3,3,2,2,1};
if (*(word32 *)(void *)(testvals+3) == 0x03030303 && *(word64 *)(void *)(testvals+1) == W64LIT(0x0202030303030202))
cout << "passed: ... |
<vulnerable_code> DSA::Verifier pub(priv);
FileSource fs2(CRYPTOPP_DATA_DIR "TestData/dsa1024b.dat", true, new HexDecoder());
DSA::Verifier pub1(fs2);
assert(pub.GetKey() == pub1.GetKey());
pass = SignatureValidate(priv, pub, thorough) && pass;
pass = RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/dsa.txt", g_null... |
<vulnerable_code> in[0] = 0xE0;
in[15] = 0;
word64 *l3Key = m_l3Key();
assert(IsAlignedOn(l3Key,GetAlignmentOf<word64>()));
for (i = 0; i <= (size_t)m_is128; i++)
do
void VMAC_Base::HashEndianCorrectedBlock(const word64 *data)
{
CRYPTOPP_UNUSED(data);
assert(false);
throw NotImplemented("VMAC: HashEndianCorre... |
<vulnerable_code> }
BOOL bResult = PulseEvent(m_startWaiting);
assert(bResult != 0); CRYPTOPP_UNUSED(bResult);
// Enterprise Analysis warning
#if defined(USE_WINDOWS8_API)
DWORD dwResult = ::WaitForMultipleObjectsEx((DWORD)m_threads.size(), threadHandles, TRUE, INFINITE, FALSE);
assert((dwResult >= W... |
<vulnerable_code> }
catch (const Exception&)
{
assert(0);
}
}
}
bool WindowsPipeReceiver::Receive(byte* buf, size_t bufLen)
{
assert(!m_resultPending && !m_eofReceived);
const HANDLE h = GetHandle();
// don't queue too much at once, or we might use up non-paged memory<commit_title>[PATCH 5/7] Update cop... |
<vulnerable_code>
void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits)
{
assert(qbits > 9); // no primes exist for pbits = 10, qbits = 9
assert(pbits > qbits);
const Integer minQ = Integer::Power2(qbits - 1);
const Integer maxQ ... |
<vulnerable_code>
void LowFirstBitWriter::StartCounting()
{
assert(!m_counting);
m_counting = true;
m_bitCount = 0;
}
unsigned long LowFirstBitWriter::FinishCounting()
{
assert(m_counting);
m_counting = false;
return m_bitCount;
}
{
m_buffer |= value << m_bitsBuffered;
m_bitsBuffered += length;
assert(m_b... |
<vulnerable_code> m_buffer |= (unsigned long)b << m_bitsBuffered;
m_bitsBuffered += 8;
}
assert(m_bitsBuffered <= sizeof(unsigned long)*8);
return true;
}
inline unsigned long LowFirstBitReader::PeekBits(unsigned int length)
{
bool result = FillBuffer(length);
CRYPTOPP_UNUSED(result); assert(result);
return m... |
<vulnerable_code>void ZlibCompressor::WritePrestreamHeader()
{
m_adler32.Restart();
assert(((GetLog2WindowSize()-8) << 4) <= 255);
byte cmf = byte(DEFLATE_METHOD | ((GetLog2WindowSize()-8) << 4));
assert((GetCompressionLevel() << 6) <= 255);
byte flags = byte(GetCompressionLevel() << 6);
AttachedTransformation()-... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ThreeWay_TestInstantiations()
{
ThreeWay::Encryption x1;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_... |
<vulnerable_code>NAMESPACE_BEGIN(CryptoPP)
namespace Weak1 {
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ARC4_TestInstantiations()
{
ARC4 x;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
namespace Weak1 {
#if CRYPTOPP_DEBUG && !defi... |
<vulnerable_code> a += b; d ^= a; d = rotlFixed<word32>(d, 8); \
c += d; b ^= c; b = rotlFixed<word32>(b, 7);
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ChaCha_TestInstantiations()
{
ChaCha8::Encryption x1;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_cod... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void DH_TestInstantiations()
{
DH dh1;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
voi... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void DH2_TestInstantiations()
{
DH2 dh(*(SimpleKeyAgreementDomain*)NULL);<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defin... |
<vulnerable_code>NAMESPACE_BEGIN(CryptoPP)
#if 0
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
static void ECDSA_TestInstantiations()
{
ECDSA<EC2N>::Signer t1;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if 0
#if CRYPTOPP_DEBUG && !defi... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ElGamal_TestInstantiations()
{
ElGamalEncryptor test1(1, 1, 1);<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CR... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ESIGN_TestInstantiations()
{
ESIGN<SHA>::Verifier x1(1, 1);<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTO... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Files_TestInstantiations()
{
FileStore f0;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCES... |
<vulnerable_code>
PolynomialMod2& PolynomialMod2::operator<<=(unsigned int n)
{
#if !defined(NDEBUG)
int x; CRYPTOPP_UNUSED(x);
CRYPTOPP_ASSERT(SafeConvert(n,x));
#endif<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
PolynomialMod2& PolynomialMod2::operator<<=(unsigned int n)
{
#if... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void TestInstantiations_gfpcrypt()
{
GDSA<SHA>::Signer test;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_D... |
<vulnerable_code>public:
// Converity finding on default ctor. We've isntrumented the code,
// and cannot uncover a case where it affects a result.
#if (defined(__COVERITY__) || !defined(NDEBUG)) && defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE)
// Repeating pattern of 1010 for debug builds to break things...
DWord() :... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void LUC_TestInstantiations()
{
LUC_HMP<SHA>::Signer t1;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYG... |
<vulnerable_code>NAMESPACE_BEGIN(CryptoPP)
namespace Weak1 {
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void MD5_TestInstantiations()
{
MD5 x;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
namespace Weak1 {
#if CRYPTOPP_DEBUG && !define... |
<vulnerable_code>#include "modes.h"
#include "misc.h"
//#ifndef NDEBUG
#include "des.h"
//#endif
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Modes_TestInstantiations()
{
CFB_Mode<DES>::Encryption m0;<commit_title>[PATCH 5/7] Update copyright message<commit_descriptio... |
<vulnerable_code>#include "algparam.h"
#include "fips140.h"
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL)
#include "pssr.h"
NAMESPACE_BEGIN(CryptoPP)
void RSA_TestInstantiations()<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
#include "al... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Salsa20_TestInstantiations()
{
Salsa20::Encryption x1;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DO... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void SEAL_TestInstantiations()
{
SEAL<>::Encryption x;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN... |
<vulnerable_code> pass=TestRDSEED() && pass;
#endif
#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS)
// http://github.com/weidai11/cryptopp/issues/92
pass=TestSecBlock() && pass;
// http://github.com/weidai11/cryptopp/issues/64
return pass;
}
#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS)
bool TestSecBlock(... |
<vulnerable_code>}
*/
#if !defined(NDEBUG) && !defined(CRYPTOPP_IMPORTS)
// Issue 64: "PolynomialMod2::operator<<=", http://github.com/weidai11/cryptopp/issues/64
bool TestPolynomialMod2()
{<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
}
*/
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_... |
<vulnerable_code>
NAMESPACE_BEGIN(CryptoPP)
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void WAKE_TestInstantiations()
{
WAKE_OFB<>::Encryption x2;<commit_title>[PATCH 5/7] Update copyright message<commit_description><fixed_code>
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DO... |
<vulnerable_code>#include "whrlpool.h"
#include "tiger.h"
#include "smartptr.h"
#include "trap.h"
#include "validate.h"
// See misc.h and trap.h for comments and usage
#if CRYPTOPP_DEBUG && (defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
static const SignalHandler<SIGTRAP, false> s_dummyHandler;
... |
<vulnerable_code> case WC_CCS_A_CS94:
if (cc.ccs == WC_CCS_US_ASCII)
cc.ccs = st->g0_ccs;
g = cs94_gmap[WC_CCS_INDEX(cc.ccs) - WC_F_ISO_BASE];
break;
case WC_CCS_A_CS94W:
is_wide = 1;
break;
#endif
}
g = cs94w_gmap[WC_CCS_INDEX(cc.ccs) - WC_F_ISO_BASE];
break;
case WC_CCS_A_CS96:
g = cs96_g... |
<vulnerable_code>
def search(request):
context_dict = {}
if 'q' in request.GET and request.GET['q'] != '':
q = request.GET['q']
cursor = connection.cursor()
cursor.execute("SELECT id,title,artist,cover FROM recordstoreapp_record WHERE title like '%" + q + "%' or artist like '%" + q + "%' or label like '%" + q +... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.