Skip to content

Commit

Permalink
Update with a few additional coverity fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Conole committed Jul 27, 2015
1 parent fe601fa commit 6e35928
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -22,4 +22,3 @@ addons:
script:
- ./configure
- make
- ./scan_script.sh
2 changes: 1 addition & 1 deletion c++-lib/src/asn-buf.cpp
Expand Up @@ -617,7 +617,7 @@ template<>
bool std::greater<SNACC::AsnBuf>::operator()(const SNACC::AsnBuf &x,
const SNACC::AsnBuf &y) const
{
AsnLen len;
AsnLen len(0);
AsnTag xTag = (BDecTag(x, len) & 0xDFFFFFFF);
AsnTag yTag = (BDecTag(y, len) & 0xDFFFFFFF);

Expand Down
2 changes: 1 addition & 1 deletion c++-lib/src/asn-int.cpp
Expand Up @@ -1466,7 +1466,7 @@ AsnLen AsnInt::PEncFullyConstrained(AsnBufBits &b, long lowerBound, long upperBo
tempInt2.m_len--;
}

if((unsigned)minBitsNeeded > (tempInt.m_len * 8))
if((unsigned)minBitsNeeded > (tempInt2.m_len * 8))
{
len += b.PutBits(pChar, minBitsNeeded - (tempInt2.m_len * 8));
minBitsNeeded -= (minBitsNeeded - (tempInt2.m_len * 8));
Expand Down
2 changes: 1 addition & 1 deletion c++-lib/src/asn-octs.cpp
Expand Up @@ -708,7 +708,7 @@ void ConsStringDeck::Fill(const AsnBuf &b, AsnLen elmtLen, AsnLen &bytesDecoded)
}
} /* end of for */

if( curr != refList.begin() )
if( curr != refList.begin() && curr != refList.end() )
{
int iTmpCount = curr->count;
curr = refList.erase(curr);
Expand Down
2 changes: 1 addition & 1 deletion c++-lib/src/asn-real.cpp
Expand Up @@ -859,7 +859,7 @@ void AsnReal::BDecContent (const AsnBuf &b, AsnTag /* tagId */, AsnLen elmtLen,
exponent = (-1 <<8) | firstExpOctet;
else
exponent = firstExpOctet;
for (;i > 0; firstExpOctet--)
for (;i > 0; firstExpOctet--, i--)
exponent = (exponent << 8) | b.GetByte();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion scan_script.sh
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand Down

0 comments on commit 6e35928

Please sign in to comment.