Skip to content

Check out of bounds for inactive type1 packet #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

magnusedgeware
Copy link
Contributor

No description provided.

@magnusedgeware magnusedgeware requested a review from a team April 14, 2025 13:38
ElasticFrameMessages result = myEFPReceiver->receiveFragmentFromPtr(reinterpret_cast<uint8_t*>(&lType1Frame), FRAME_SIZE, 0);
EXPECT_EQ(result, ElasticFrameMessages::noError);

// test with corrup type1 packet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// test with corrup type1 packet
// test with corrupt type1 packet

Copy link
Contributor

@tomasoh-ateliere tomasoh-ateliere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted! Check if this might be an issue for other frame types as well.

@magnusedgeware magnusedgeware force-pushed the fix-corrupt-type1-packet branch 3 times, most recently from db2100b to 93c3012 Compare April 15, 2025 12:31
@magnusedgeware
Copy link
Contributor Author

I found that the unit tests did not work as expected so I improved them.

std::generate(garbage.begin(), garbage.end(),
[&]() { return static_cast<uint8_t>(dis(gen)); });

ElasticFrameMessages info = myEFPReceiver->receiveFragment(garbage, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable

@magnusedgeware magnusedgeware force-pushed the fix-corrupt-type1-packet branch from bc2947c to 9a6c166 Compare April 15, 2025 14:23
@magnusedgeware magnusedgeware merged commit a6d084b into master Apr 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants