Skip to content

Commit

Permalink
Add test case for atEof UB
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Oct 1, 2024
1 parent cea730a commit 3059123
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/Test_EncryptedStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ TEST_CASE("EncryptedStream known values", "[streams]")
REQUIRE(stream.getEncType() == DS::EncryptedStream::Type::e_xxtea);
REQUIRE(stream.size() == resultsz);

REQUIRE_FALSE(stream.atEof());

char test[sizeof(result)];
stream.readBytes(test, resultsz);
test[sizeof(test) - 1] = 0;
Expand All @@ -59,6 +61,8 @@ TEST_CASE("EncryptedStream known values", "[streams]")
REQUIRE(stream.getEncType() == DS::EncryptedStream::Type::e_tea);
REQUIRE(stream.size() == resultsz);

REQUIRE_FALSE(stream.atEof());

char test[sizeof(result)];
stream.readBytes(test, resultsz);
test[sizeof(test) - 1] = 0;
Expand Down

0 comments on commit 3059123

Please sign in to comment.