Skip to content

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