command: initialize netcmd->cmd_source_len before recvfrom()

This commit is contained in:
jsd1982 2021-05-13 22:11:01 -05:00
parent cc5b491e21
commit b3eebbd5ec

View File

@ -166,6 +166,7 @@ static void command_network_poll(command_t *handle)
char buf[1024];
buf[0] = '\0';
netcmd->cmd_source_len = sizeof(struct sockaddr_storage);
ret = recvfrom(netcmd->net_fd, buf, sizeof(buf) - 1, 0,
(struct sockaddr*)&netcmd->cmd_source,
&netcmd->cmd_source_len);