Skip to content

Commit c435355

Browse files
authored
Merge branch '0neblock:master' into master
2 parents 291e3d6 + eed3ca0 commit c435355

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/BERDecode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int IntegerType::fromBuffer(const uint8_t *buf, size_t max_len){
8989
break;
9090
case 3:
9191
if(tempVal & 0x00800000){
92-
tempVal = tempVal |= 0xFF000000;
92+
tempVal |= 0xFF000000;
9393
}
9494
_value = (int32_t)tempVal;
9595
break;

tests/tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ TEST_CASE( "Test handle failures when Encoding/Decoding", "[snmp]"){
5959
REQUIRE( readPack->parseFrom(buffer, 133) == SNMP_ERROR_OK );
6060
}
6161

62-
SECTION( "Should fail to parse a corrupt buffer "){
62+
/* SECTION( "Should fail to parse a corrupt buffer "){
6363
SNMPPacket* readPacket = new SNMPPacket();
6464
for(int i = 25; i < 133; i+= 10){
6565
char old[10] = {0};
6666
memcpy(old, &buffer[i], 10);
6767
long randomLong = random();
68-
memcpy(&buffer[i], &randomLong, 10);
68+
memcpy(&buffer[i], &randomLong, sizeof(randomLong));
6969
// This may SOMETIMES fail if the random gets lucky and makes something valid
7070
REQUIRE( readPacket->parseFrom(buffer, 200) != SNMP_ERROR_OK );
7171
7272
memcpy(&buffer[i], old, 10);
7373
REQUIRE( readPacket->parseFrom(buffer, 200) == SNMP_ERROR_OK );
7474
}
75-
}
75+
} */
7676
}
7777

7878
TEST_CASE( "Test Encoding/Decoding packet", "[snmp]" ) {

0 commit comments

Comments
 (0)