Skip to content
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

Update network.c #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sl1200mk2
Copy link
Contributor

add check in artnet_net_recv() for not receiving ArtPoll from the sender (autoloop)

add check in artnet_net_recv() for not receiving ArtPoll from the sender (autoloop)
@@ -622,7 +622,8 @@ int artnet_net_recv(node n, artnet_packet p, int delay) {
return ARTNET_ENET;
}

if (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
if (((cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr) &&
!memcmp(p->data.ar.longname, n->state.long_name, ARTNET_LONG_NAME_LENGTH * sizeof(uint8_t)))||
Copy link
Member

Choose a reason for hiding this comment

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

This is dangerous, it doesn't check the length of the received packet so it touched an out-of-bounds memory location.

See my comments on the issue.

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.

2 participants